|
@@ -5,11 +5,13 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
const webpack = require('webpack');
|
|
const webpack = require('webpack');
|
|
-const proxyHost = "http://192.168.2.236:5050";
|
|
|
|
|
|
+// const proxyHost = "http://192.168.2.236:5050";
|
|
|
|
+const proxyHost = "http://192.168.3.150:3456";
|
|
module.exports = {
|
|
module.exports = {
|
|
entry: {
|
|
entry: {
|
|
index: path.resolve(__dirname, 'src/js', 'index.js'),
|
|
index: path.resolve(__dirname, 'src/js', 'index.js'),
|
|
knowledgeTree: path.resolve(__dirname, 'src/js', 'knowledgeTree.js'),
|
|
knowledgeTree: path.resolve(__dirname, 'src/js', 'knowledgeTree.js'),
|
|
|
|
+ participle: path.resolve(__dirname,'src/js', 'participle.js'),
|
|
vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
|
|
vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
|
|
},
|
|
},
|
|
output: {
|
|
output: {
|
|
@@ -48,6 +50,19 @@ module.exports = {
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
collapseWhitespace: true //删除空白符与换行符
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
+ title: 'participle',
|
|
|
|
+ template: path.resolve(__dirname, 'src/html', 'participle.html'),
|
|
|
|
+ filename: 'participle.html',
|
|
|
|
+ chunks: ['participle', 'vendor', 'common'],
|
|
|
|
+ inject: true,
|
|
|
|
+ hash: true, //防止缓存
|
|
|
|
+ minify: {
|
|
|
|
+ removeAttributeQuotes: true, //压缩 去掉引号
|
|
|
|
+ removeComments: true, //移除HTML中的注释
|
|
|
|
+ collapseWhitespace: true //删除空白符与换行符
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
new MiniCssExtractPlugin({
|
|
new MiniCssExtractPlugin({
|
|
filename: 'css/[name].css',
|
|
filename: 'css/[name].css',
|
|
chunkFilename: '[id].css'
|
|
chunkFilename: '[id].css'
|