|
@@ -13,7 +13,7 @@ module.exports = {
|
|
|
drugInfo: path.resolve(__dirname, 'src/js', 'drugInfo.js'),
|
|
|
disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
|
|
|
scale: path.resolve(__dirname, 'src/js', 'scale.js'),
|
|
|
- vendor:'lodash' // 多个页面所需的公共库文件,防止重复打包带入
|
|
|
+ vendor:'lodash', // 多个页面所需的公共库文件,防止重复打包带入
|
|
|
},
|
|
|
output: {
|
|
|
publicPath: '/', //这里要放的是静态资源CDN的地址
|
|
@@ -82,7 +82,7 @@ module.exports = {
|
|
|
title: 'disclaimer',
|
|
|
template: path.resolve(__dirname, 'src/html', 'disclaimer.html'),
|
|
|
filename: 'disclaimer.html',
|
|
|
- chunks: ['disclaimer', 'vendor','common'],
|
|
|
+ chunks: ['vendor','common','disclaimer'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -95,7 +95,7 @@ module.exports = {
|
|
|
title: 'scale',
|
|
|
template: path.resolve(__dirname, 'src/html', 'scale.html'),
|
|
|
filename: 'scale.html',
|
|
|
- chunks: ['scale', 'vendor','common'],
|
|
|
+ chunks: ['vendor','common','scale'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -135,6 +135,16 @@ module.exports = {
|
|
|
test: /\.js$/,
|
|
|
use: "imports-loader?$=jquery"
|
|
|
},
|
|
|
+ {
|
|
|
+ test: /\.m?js$/,
|
|
|
+ exclude: /(node_modules|bower_components)/,
|
|
|
+ use: {
|
|
|
+ loader: 'babel-loader',
|
|
|
+ options: {
|
|
|
+ presets: ['@babel/preset-env']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
test: /\.css$/,
|
|
|
use: [{
|
|
@@ -158,14 +168,14 @@ module.exports = {
|
|
|
loader: 'file-loader',
|
|
|
options: {
|
|
|
outputPath: 'images/', // 图片输出的路径和存储路径保持一致
|
|
|
- limit: 100,
|
|
|
+ limit: 10000,
|
|
|
name: '[name].[ext]'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
]
|
|
|
},
|
|
|
- devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map //生产环境cheap-module-source-map
|
|
|
+ // devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map //生产环境cheap-module-source-map
|
|
|
devServer: {
|
|
|
contentBase: path.join(__dirname, "dist"), //静态文件根目录
|
|
|
proxy: {
|