You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

/**
* Created by Jacky.Gao on 2018-04-15.
* Base on Webpack4
*/
const path = require('path');
module.exports = {
mode: 'development',
entry: {
designer: './src/index.js',
searchform: './src/form/index.js',
preview: './src/preview.js'
},
output: {
path: path.resolve('html/js'),
filename: '[name].bundle.js'
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
// 抽离第三方插件
test: /handsontable|codemirror|chart.js/,
chunks: 'initial',
name: 'common',
priority: 10
}
}
}
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.css$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}]
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
use: [{
loader: 'url-loader',
options: {
limit: 10000000
}
}]
}
]
}
};