mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui-library.git
synced 2025-11-20 20:04:49 +00:00
fixed webpack again
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tip-wlan/wlan-cloud-ui-library",
|
"name": "@tip-wlan/wlan-cloud-ui-library",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tip-wlan/wlan-cloud-ui-library",
|
"name": "@tip-wlan/wlan-cloud-ui-library",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"author": "NetExperience",
|
"author": "NetExperience",
|
||||||
"description": "React UI Library",
|
"description": "React UI Library",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -1,27 +1,19 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
||||||
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: process.env.NODE_ENV,
|
mode: process.env.NODE_ENV,
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.join(__dirname, 'dist'),
|
||||||
publicPath: '/dist/',
|
publicPath: '/dist/',
|
||||||
filename: `index.js`,
|
filename: 'index.js',
|
||||||
|
library: '@tip-wlan/wlan-cloud-ui-library',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
library: {
|
|
||||||
name: '@tip-wlan/wlan-cloud-ui-library',
|
|
||||||
type: 'umd',
|
|
||||||
},
|
|
||||||
umdNamedDefine: true,
|
umdNamedDefine: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
target: 'node', // ingore all dependencies
|
|
||||||
|
|
||||||
externals: [
|
externals: [
|
||||||
{
|
{
|
||||||
react: {
|
react: {
|
||||||
@@ -72,31 +64,22 @@ module.exports = {
|
|||||||
use: ['babel-loader', 'eslint-loader'],
|
use: ['babel-loader', 'eslint-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(css|scss)$/,
|
// Preprocess 3rd party .css files located in node_modules
|
||||||
use: [
|
test: /\.css$/,
|
||||||
MiniCssExtractPlugin.loader,
|
include: /node_modules/,
|
||||||
{
|
use: ['style-loader', 'css-loader'],
|
||||||
loader: 'css-loader',
|
|
||||||
options: {
|
|
||||||
sourceMap: false,
|
|
||||||
localsConvention: 'camelCase',
|
|
||||||
modules: {
|
|
||||||
localIdentName: '[local]___[hash:base64:5]',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'sass-loader',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.less$/,
|
test: /\.less$/,
|
||||||
use: [
|
use: [
|
||||||
MiniCssExtractPlugin.loader,
|
{
|
||||||
|
loader: 'style-loader',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
loader: 'css-loader',
|
loader: 'css-loader',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: 'less-loader', // compiles Less to CSS
|
loader: 'less-loader',
|
||||||
options: {
|
options: {
|
||||||
lessOptions: {
|
lessOptions: {
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
@@ -105,24 +88,46 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.(css|scss)$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'style-loader',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
loader: 'css-loader',
|
||||||
|
options: {
|
||||||
|
modules: {
|
||||||
|
localIdentName: '[name]__[local]___[hash:base64:5]',
|
||||||
|
},
|
||||||
|
sourceMap: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
loader: 'sass-loader',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: ['node_modules', 'src'],
|
modules: [path.resolve('./node_modules'), path.resolve('./src')],
|
||||||
alias: {
|
alias: {
|
||||||
app: path.resolve(__dirname, '../', 'src'),
|
src: path.resolve(__dirname, './src'),
|
||||||
|
react: path.resolve(__dirname, './node_modules/react'),
|
||||||
|
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
|
||||||
|
antd: path.resolve(__dirname, './node_modules/antd'),
|
||||||
|
'@ant-design/icons': path.resolve(__dirname, './node_modules/@ant-design/icons'),
|
||||||
|
'prop-types': path.resolve(__dirname, './node_modules/prop-types'),
|
||||||
|
'react-router-dom': path.resolve(__dirname, './node_modules/react-router-dom'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
|
|
||||||
new MiniCssExtractPlugin({
|
|
||||||
filename: `css/[name].css`,
|
|
||||||
chunkFilename: `css/[hash].css`,
|
|
||||||
}),
|
|
||||||
|
|
||||||
// new BundleAnalyzerPlugin(),
|
// new BundleAnalyzerPlugin(),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user