|
@@ -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的地址
|
|
@@ -30,7 +30,7 @@ module.exports = {
|
|
|
title: 'index',
|
|
|
template: path.resolve(__dirname, 'src/html', 'index.html'),
|
|
|
filename: 'index.html',
|
|
|
- chunks: ['index', 'vendor','common'],
|
|
|
+ chunks: ['index', 'vendor', 'common'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -43,7 +43,7 @@ module.exports = {
|
|
|
title: 'page',
|
|
|
template: path.resolve(__dirname, 'src/html', 'page.html'),
|
|
|
filename: 'page.html',
|
|
|
- chunks: ['page', 'vendor','common'],
|
|
|
+ chunks: ['page', 'vendor', 'common'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -56,7 +56,7 @@ module.exports = {
|
|
|
title: 'information',
|
|
|
template: path.resolve(__dirname, 'src/html', 'information.html'),
|
|
|
filename: 'information.html',
|
|
|
- chunks: ['information', 'vendor','common'],
|
|
|
+ chunks: ['information', 'vendor', 'common'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -69,7 +69,7 @@ module.exports = {
|
|
|
title: 'drugInfo',
|
|
|
template: path.resolve(__dirname, 'src/html', 'drugInfo.html'),
|
|
|
filename: 'drugInfo.html',
|
|
|
- chunks: ['drugInfo', 'vendor','common'],
|
|
|
+ chunks: ['drugInfo', 'vendor', 'common'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -82,7 +82,7 @@ module.exports = {
|
|
|
title: 'disclaimer',
|
|
|
template: path.resolve(__dirname, 'src/html', 'disclaimer.html'),
|
|
|
filename: 'disclaimer.html',
|
|
|
- chunks: ['vendor','common','disclaimer'],
|
|
|
+ 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: ['vendor','common','scale'],
|
|
|
+ chunks: ['vendor', 'common', 'scale'],
|
|
|
inject: true,
|
|
|
hash: true, //防止缓存
|
|
|
minify: {
|
|
@@ -127,11 +127,9 @@ module.exports = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
module: {
|
|
|
- // 多个loader是有顺序要求的,从右往左写,因为转换的时候是从右往左转换的
|
|
|
- rules: [
|
|
|
- {
|
|
|
+ rules: [{// 多个loader是有顺序要求的,从右往左写,因为转换的时候是从右往左转换的
|
|
|
test: /\.js$/,
|
|
|
use: "imports-loader?$=jquery"
|
|
|
},
|
|
@@ -159,7 +157,7 @@ module.exports = {
|
|
|
},
|
|
|
{
|
|
|
test: /\.less$/,
|
|
|
- use: ['style-loader','css-loader','less-loader']
|
|
|
+ use: ['style-loader', 'css-loader', 'less-loader']
|
|
|
},
|
|
|
{ //file-loader 解决css等文件中引入图片路径的问题
|
|
|
// url-loader 当图片较小的时候会把图片BASE64编码,大于limit参数的时候还是使用file-loader 进行拷贝
|
|
@@ -176,7 +174,7 @@ module.exports = {
|
|
|
]
|
|
|
},
|
|
|
// devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map //生产环境cheap-module-source-map
|
|
|
- mode: 'production',
|
|
|
+ mode: 'development',
|
|
|
devServer: {
|
|
|
contentBase: path.join(__dirname, "dist"), //静态文件根目录
|
|
|
proxy: {
|