Commit 9ce2a4e5 by 冒粤蓉

add webpack.config

1 parent ff6f0371
......@@ -2,6 +2,7 @@ var path = require('path')
var webpack = require('webpack')
const { port } = require("../package");
const htmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
......@@ -13,8 +14,8 @@ const templateFunction = require('./sprite')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
//localhost:10500
const IS_DEV_MODE = process.env.NODE_ENV !== 'production'
const getPublicPath = IS_DEV_MODE ? '' : '/ots/vue/build/';
const resourcesPath = IS_DEV_MODE ? `//localhost:${port}` : 'http://eshield-perm.test.glsx.com.cn';
const getPublicPath = IS_DEV_MODE ? '' : './';
const resourcesPath = IS_DEV_MODE ? `//localhost:${port}` : 'http://e-shield-old.frontend.test.glsx.com.cn/';
module.exports = {
mode: IS_DEV_MODE ? 'development':'production',
......@@ -116,7 +117,11 @@ module.exports = {
],
},
plugins: [
new htmlWebpackPlugin({
chunks: ['main'],
filename: 'index.html',
template: path.resolve(__dirname, `../dist/index.html`)
}),
new webpack.HotModuleReplacementPlugin(),
/*new SpritesmithPlugin({
src: {
......
......@@ -2,15 +2,16 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>v-simple</title>
<title>试乘试驾</title>
</head>
<!-- <link rel="stylesheet" href="css/main.5163fe9d199e8bbd0277.min.css"> -->
<body>
<div id="glsx-sub-system"></div>
<script src="lib/pace.min.js"></script>
<script src="lib/vue.min.js"></script>
<script src="lib/element-ui.js"></script>
<script src="lib/moment.min.js"></script>
<script src="js/main.bundle.js"></script>
<!-- <script src="js/main.5163fe9d199e8bbd0277.bundle.js"></script> -->
<!-- <script src="js/runtime.bundle.js"></script> -->
</body>
</html>
......@@ -44,6 +44,7 @@
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.4",
"hard-source-webpack-plugin": "^0.6.4",
"html-webpack-plugin": "^3.2.0",
"http-proxy-middleware": "^0.18.0",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "^4.14.1",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!