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.

70 lines
1.8 KiB

преди 7 години
/**
* Created by Jacky.Gao on 2018-04-15.
* Base on Webpack4
преди 7 години
*/
const path=require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports={
mode:'production',
преди 7 години
entry: {
designer:'./src/index.js',
преди 6 години
searchform:'./src/form/index.js',
преди 7 години
preview:'./src/preview.js'
},
output:{
path:path.resolve('../ureport2-console/src/main/resources/ureport-asserts/js'),
filename:'[name].bundle.js'
преди 7 години
},
преди 6 години
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
// 抽离第三方插件
test: /handsontable|codemirror/,
chunks: 'initial',
name: 'common',
priority: 10
}
}
}
},
plugins:[
new UglifyJsPlugin(
{
uglifyOptions: {
warnings: false,
output: {
comments: false
},
compress: {
drop_console: true
}
}
преди 7 години
}
)
преди 7 години
],
module:{
rules:[
преди 7 години
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
преди 7 години
},
{
test:/\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
преди 7 години
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 10000000
}
}
]
преди 7 години
}
]
}
};