1 Star 0 Fork 19

components-library/ElementUI_table_form

forked from 咦乌喻/cc-element 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 2.38 KB
一键复制 编辑 原始数据 按行查看 历史
chenpeng 提交于 2021-06-16 17:46 . 修改
/*
* @Description:
* @Date: 2021-04-29 14:51:17
* @LastEditTime: 2021-06-15 18:53:36
* @FilePath: \web-template\vue.config.js
* @Author: Devin
*/
const CompressionPlugin = require("compression-webpack-plugin")
// const name = defaultSettings.title || 'vue Admin Template' // page title
const port = process.env.port || process.env.npm_config_port || 9590 // dev port
// let timeStamp = new Date().getTime(); // 获取当前的时间戳
// 是否为生产环境
const isProduction = process.env.NODE_ENV !== 'development'
module.exports = {
// filenameHashing: false, // 打包的时候不使用hash值.因为我们有时间戳来确定项目的唯一性了/
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: false,
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
css: {
loaderOptions: {
// 给 sass-loader 传递选项
sass: {
// 所以这里假设你有 `src/variables.scss` 这个文件
data: `@import "@/styles/variables.scss";`
}
},
// extract: { // 打包后css文件名称添加时间戳
// filename: `css/[name].${ timeStamp }.css`,
// chunkFilename: `css/[name].${ timeStamp }.css`,
// }
},
devServer: {
hot: true,
port: port,
open: true,
overlay: {
warnings: false,
errors: false
},
disableHostCheck: true
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader
// config.entry('main').add('babel-polyfill')
// // 开启图片压缩
// config.module.rule('images')
// .test(/\.(png|jpe?g|gif|svg)(\?.*)?$/)
// .use('image-webpack-loader')
// .loader('image-webpack-loader')
// .options({ bypassOnDebug: true })
if (isProduction) {
config.plugin('compressionPlugin')
.use(new CompressionPlugin({
test: /\.js$|\.html$|.\css/, // 匹配文件名
threshold: 10240, // 对超过10M的数据压缩
deleteOriginalAssets: false // 不删除源文件
}))
// 去掉元素之间的空格
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/components-library/element-ui_table_form.git
git@gitee.com:components-library/element-ui_table_form.git
components-library
element-ui_table_form
ElementUI_table_form
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385