Commit 117b8cf2 by 无尘

feat: 增加配置

parent 1117fba6
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"clipboard": "^2.0.4", "clipboard": "^2.0.4",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"element-ui": "^2.10.0", "element-ui": "^2.13.2",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
/*
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-07-16 17:43:42
*/
import 'babel-polyfill';
import '@/styles/reset.less'; import '@/styles/reset.less';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import './images/font-icon/iconfont.css'; import './images/font-icon/iconfont.css';
......
/*
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-07-16 17:43:11
*/
const path = require("path"); const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir)
}
const port = process.env.port || process.env.npm_config_port || 8087 // dev port
module.exports = { module.exports = {
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: process.env.NODE_ENV !== 'production', productionSourceMap: process.env.NODE_ENV !== 'production',
// publicPath: process.env.NODE_ENV === 'production' ? '/damo-system' : '/', // publicPath: process.env.NODE_ENV === 'production' ? '/damo-system' : '/',
devServer: { devServer: {
port: port,
open: true,
overlay: { overlay: {
warnings: true, warnings: false,
errors: true errors: true
} },
// proxy: {}
}, },
configureWebpack: config => { configureWebpack: config => {
config.externals = { config.externals = {
vue: 'Vue', vue: 'Vue',
vuex: 'Vuex', vuex: 'Vuex',
axios: 'axios', axios: 'axios',
}; };
config.resolve = {
alias: {
'@': resolve('src')
}
};
config.entry.app = ["babel-polyfill", "./src/main.js"];
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false; config.optimization.minimizer[0].options.terserOptions.compress.warnings = false;
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true; config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment