swh:1:snp:4a943ce69090898ed8488f175cc92d3407bcf125
Tip revision: 67b8c9582902a98997901325bb52ef34c248c844 authored by zhaosong_Huang on 05 April 2020, 07:20:15 UTC
Merge pull request #4 from wintericie/patch-1
Merge pull request #4 from wintericie/patch-1
Tip revision: 67b8c95
webpack.production.config.js
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var productionConfig = [{
entry: {
page1: './client/page1',
page2: './client/page2'
},
output: {
filename: './[name]/bundle.js',
path: path.resolve(__dirname, './public'),
publicPath: '/'
},
module: {
rules: [{
test: /\.(png|jpg)$/,
use: 'url-loader?limit=8192&context=client&name=[path][name].[ext]'
}, {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'resolve-url-loader', 'sass-loader?sourceMap']
})
}]
},
plugins: [
new CleanWebpackPlugin(['public']),
new ExtractTextPlugin({
filename: './[name]/index.css',
allChunks: true
})
]
}];
module.exports = productionConfig;