|
@@ -13,6 +13,7 @@ module.exports = {
|
|
|
knowledgeTree: path.resolve(__dirname, 'src/js', 'knowledgeTree.js'),
|
|
|
participle: path.resolve(__dirname,'src/js', 'participle.js'),
|
|
|
qaPage:path.resolve(__dirname,'src/js', 'qaPage.js'),
|
|
|
+ medicalTermMap:path.resolve(__dirname,'src/js', 'medicalTermMap.js'),
|
|
|
vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
|
|
|
},
|
|
|
output: {
|
|
@@ -63,31 +64,45 @@ module.exports = {
|
|
|
removeComments: true, //移除HTML中的注释
|
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
|
}
|
|
|
- }),new HtmlWebpackPlugin({
|
|
|
- title: '智能问答',
|
|
|
- template: path.resolve(__dirname, 'src/html', 'qaPage.html'),
|
|
|
- filename: 'qaPage.html',
|
|
|
- chunks: ['qaPage', 'vendor', 'common'],
|
|
|
- inject: true,
|
|
|
- hash: true, //防止缓存
|
|
|
- minify: {
|
|
|
- removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
- removeComments: true, //移除HTML中的注释
|
|
|
- collapseWhitespace: true //删除空白符与换行符
|
|
|
- }
|
|
|
- }),
|
|
|
- new MiniCssExtractPlugin({
|
|
|
- filename: 'css/[name].css',
|
|
|
- chunkFilename: '[id].css'
|
|
|
- }),
|
|
|
- new webpack.ProvidePlugin({
|
|
|
- $: 'jquery',
|
|
|
- jQuery: 'jquery',
|
|
|
- 'window.jQuery': 'jquery'
|
|
|
- }),
|
|
|
- new webpack.HotModuleReplacementPlugin(),
|
|
|
- new CleanWebpackPlugin(),
|
|
|
- new ExtractTextPlugin("stylesheets/[name].css"),
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '智能问答',
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'qaPage.html'),
|
|
|
+ filename: 'qaPage.html',
|
|
|
+ chunks: ['qaPage', 'vendor', 'common'],
|
|
|
+ inject: true,
|
|
|
+ hash: true, //防止缓存
|
|
|
+ minify: {
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '医学术语映射',
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'medicalTermMap.html'),
|
|
|
+ filename: 'medicalTermMap.html',
|
|
|
+ chunks: ['medicalTermMap', 'vendor', 'common'],
|
|
|
+ inject: true,
|
|
|
+ hash: true, //防止缓存
|
|
|
+ minify: {
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ new MiniCssExtractPlugin({
|
|
|
+ filename: 'css/[name].css',
|
|
|
+ chunkFilename: '[id].css'
|
|
|
+ }),
|
|
|
+ new webpack.ProvidePlugin({
|
|
|
+ $: 'jquery',
|
|
|
+ jQuery: 'jquery',
|
|
|
+ 'window.jQuery': 'jquery'
|
|
|
+ }),
|
|
|
+ new webpack.HotModuleReplacementPlugin(),
|
|
|
+ new CleanWebpackPlugin(),
|
|
|
+ new ExtractTextPlugin("stylesheets/[name].css"),
|
|
|
],
|
|
|
optimization: { //webpack4.x的最新优化配置项,用于提取公共代码
|
|
|
minimizer: [
|