|
|
@@ -1,23 +1,21 @@
|
|
|
var path = require('path');
|
|
|
var webpack = require('webpack');
|
|
|
+var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
|
|
|
module.exports = {
|
|
|
- // entry: ['whatwg-fetch', path.resolve(__dirname, './app/main.js')],
|
|
|
entry: {
|
|
|
- fetch: 'whatwg-fetch',
|
|
|
- main: './app/main.js',
|
|
|
- title: './app/src/Title/Title.jsx',
|
|
|
- table: './app/component/Table.jsx',
|
|
|
- form: './app/src/Form/index.js',
|
|
|
- chart: './app/src/Charts/ECharts.js'
|
|
|
+ 'fetch/whatwg-fetch': 'whatwg-fetch',
|
|
|
+ 'src/main': './app/main.js',
|
|
|
+ 'src/title': './app/src/Title/Title.jsx',
|
|
|
+ 'src/table': './app/component/Table.jsx',
|
|
|
+ 'src/form': './app/src/Form/index.js',
|
|
|
+ 'src/chart': './app/src/Charts/ECharts.js'
|
|
|
},
|
|
|
externals: {
|
|
|
echarts: 'window.echarts',
|
|
|
},
|
|
|
output: {
|
|
|
path: path.resolve(__dirname, './build'),
|
|
|
- // filename: 'bundle.js',
|
|
|
- // publicPath: '/',
|
|
|
filename: '[name].bundle.js'
|
|
|
},
|
|
|
module: {
|
|
|
@@ -65,6 +63,12 @@ module.exports = {
|
|
|
"process.env": {
|
|
|
NODE_ENV: JSON.stringify("production")
|
|
|
}
|
|
|
+ }),
|
|
|
+ new ExtractTextPlugin({
|
|
|
+ filename: (getPath) => {
|
|
|
+ return getPath('css/[name].css').replace('css/js', 'css');
|
|
|
+ },
|
|
|
+ allChunks: true
|
|
|
})
|
|
|
]
|
|
|
};
|