rj-tool-test
Version:
rj tool
43 lines (37 loc) • 1.24 kB
JavaScript
/**
* Created by feichongzheng on 16/12/7.
*/
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanPlugin = require('clean-webpack-plugin');
// const PreloadWebpackPlugin = require('preload-webpack-plugin');
const webpackModule = require('./module');
module.exports = ({rootDir}) => {
return {
mode: 'production',
entry: ['babel-polyfill', rootDir + '/app/index.js'],
output: {
path: rootDir + '/dist',
filename: 'js/[name]-[hash:8].js',
chunkFilename: 'js/[name]-[id].[hash:8].bundle.js',
},
module: webpackModule,
plugins: [
new CleanPlugin(['dist'], {
'root': rootDir,
'verbose': true,
'dry': false,
}),
new HtmlWebpackPlugin({
template: rootDir + '/app/index.html',
}),
// new PreloadWebpackPlugin({
// rel: 'preload',
// include: ['Uc','App']
// }),
new CopyWebpackPlugin([
{from: rootDir + '/assets', to: rootDir + '/dist/assets'},
]),
],
}
};