|
@@ -7,11 +7,16 @@ const webpack = require('webpack');
|
|
const proxyHost = "http://10.11.21.173:5050";
|
|
const proxyHost = "http://10.11.21.173:5050";
|
|
module.exports = {
|
|
module.exports = {
|
|
entry: {
|
|
entry: {
|
|
|
|
+ landscapePage: path.resolve(__dirname, 'src', 'landscapePage.js'),
|
|
|
|
+ landscape: path.resolve(__dirname, 'src', 'landscape.js'),
|
|
|
|
+ landscapeMedical: path.resolve(__dirname, 'src/js', 'landscapeMedical.js'),
|
|
index: path.resolve(__dirname, 'src', 'index.js'),
|
|
index: path.resolve(__dirname, 'src', 'index.js'),
|
|
page: path.resolve(__dirname, 'src', 'page.js'),
|
|
page: path.resolve(__dirname, 'src', 'page.js'),
|
|
information: path.resolve(__dirname, 'src/js', 'information.js'),
|
|
information: path.resolve(__dirname, 'src/js', 'information.js'),
|
|
disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
|
|
disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
|
|
scale: path.resolve(__dirname, 'src/js', 'scale.js'),
|
|
scale: path.resolve(__dirname, 'src/js', 'scale.js'),
|
|
|
|
+ illness: path.resolve(__dirname, 'src/js', 'illness.js'),
|
|
|
|
+ treatplan: path.resolve(__dirname, 'src/js', 'treatplan.js'),
|
|
vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
|
|
vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
|
|
},
|
|
},
|
|
output: {
|
|
output: {
|
|
@@ -37,6 +42,32 @@ module.exports = {
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: '病情提示',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'illness.html'),
|
|
|
|
+ filename: 'illness.html',
|
|
|
|
+ chunks: ['illness', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: '治疗方案',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'treatplan.html'),
|
|
|
|
+ filename: 'treatplan.html',
|
|
|
|
+ chunks: ['treatplan', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
new HtmlWebpackPlugin({
|
|
new HtmlWebpackPlugin({
|
|
title: 'page',
|
|
title: 'page',
|
|
template: path.resolve(__dirname, 'src/html', 'page.html'),
|
|
template: path.resolve(__dirname, 'src/html', 'page.html'),
|
|
@@ -50,6 +81,19 @@ module.exports = {
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: 'landscapePage',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'landscapePage.html'),
|
|
|
|
+ filename: 'landscapePage.html',
|
|
|
|
+ chunks: ['landscapePage', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
new HtmlWebpackPlugin({
|
|
new HtmlWebpackPlugin({
|
|
title: 'information',
|
|
title: 'information',
|
|
template: path.resolve(__dirname, 'src/html', 'information.html'),
|
|
template: path.resolve(__dirname, 'src/html', 'information.html'),
|
|
@@ -106,6 +150,32 @@ module.exports = {
|
|
filename: 'css/[name].css',
|
|
filename: 'css/[name].css',
|
|
chunkFilename: '[id].css'
|
|
chunkFilename: '[id].css'
|
|
}),
|
|
}),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: 'landscape',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'landscape.html'),
|
|
|
|
+ filename: 'landscape.html',
|
|
|
|
+ chunks: ['landscape', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: 'landscapeMedical',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'landscapeMedical.html'),
|
|
|
|
+ filename: 'landscapeMedical.html',
|
|
|
|
+ chunks: ['landscapeMedical', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new CleanWebpackPlugin()
|
|
new CleanWebpackPlugin()
|
|
],
|
|
],
|
|
@@ -168,7 +238,21 @@ module.exports = {
|
|
'css-loader'
|
|
'css-loader'
|
|
]
|
|
]
|
|
},
|
|
},
|
|
- {
|
|
|
|
|
|
+ {
|
|
|
|
+ test: /\.less$/,
|
|
|
|
+ use: [
|
|
|
|
+ {
|
|
|
|
+ loader: 'style-loader', // creates style nodes from JS strings
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ loader: 'css-loader', // translates CSS into CommonJS
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ loader: 'less-loader', // compiles Less to CSS
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
test: /\.(png|jpg|jpeg|gif|svg)$/,
|
|
test: /\.(png|jpg|jpeg|gif|svg)$/,
|
|
use: {
|
|
use: {
|
|
loader: 'file-loader',
|
|
loader: 'file-loader',
|
|
@@ -184,7 +268,7 @@ module.exports = {
|
|
// 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
|
|
mode: 'development',
|
|
mode: 'development',
|
|
devServer: {
|
|
devServer: {
|
|
- contentBase: path.join(__dirname, "dist"), //静态文件根目录
|
|
|
|
|
|
+ contentBase: "./dist", //静态文件根目录
|
|
proxy: {
|
|
proxy: {
|
|
'/api': proxyHost
|
|
'/api': proxyHost
|
|
},
|
|
},
|