2 Star 3 Fork 2

shiyutian/apaas-custom-vue-starter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 2.73 KB
一键复制 编辑 原始数据 按行查看 历史
唐炜 提交于 2022-07-19 17:12 +08:00 . Update vue.config.js
/*
* @Author: your name
* @Date: 2020-05-27 09:29:16
* @LastEditTime: 2020-05-27 11:00:29
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: /x-product-workspace/packages/x-project-app/vue.config.js
*/
'use strict'
'use strict'
const path = require('path')
const resolve = (dir) => {
return path.join(__dirname, './', dir)
}
const isProd = () => {
return process.env.NODE_ENV === 'production'
}
module.exports = {
publicPath: process.env.VUE_APP_PUBLIC_PATH,
assetsDir: 'public',
lintOnSave: isProd(),
productionSourceMap: false,
transpileDependencies: [
'@x-ui/x-dcloud-ui',
'@x-apaas/x-lib-rule-engine',
'@x-apaas/x-dcloud-page-web',
'x-extension'
],
runtimeCompiler: true,
// webpack-dev-server 相关配置
devServer: {
open: process.platform === 'darwin',
host: '0.0.0.0',
port: '8081',
disableHostCheck: false,
https: false,
hotOnly: false,
overlay: {
warnings: false,
errors: true
}
},
css: {
loaderOptions: {
sass: {
prependData: `
@import "@/assets/scss/variable.scss";
`
}
}
},
pwa: {
iconPaths: {
favicon32: './favicon.ico',
favicon16: './favicon.ico',
appleTouchIcon: './favicon.ico',
maskIcon: './favicon.ico',
msTileImage: './favicon.ico'
}
},
configureWebpack: () => ({
name: 'vue-cli3-template',
resolve: {
alias: {
// vue动态值
vue$: 'vue/dist/vue.esm.js',
// vue快速路径
'@': resolve('src')
}
},
plugins: []
}),
chainWebpack: (config) => {
// webpack-html-plugin
// config.plugin('html').tap((options) => {
// options[0].title = '得帆云 MDM平台'
// options[0].minify = {
// removeComments: true,
// collapseWhitespace: true,
// removeAttributeQuotes: true,
// useShortDoctype: true,
// removeEmptyAttributes: true,
// removeStyleLinkTypeAttributes: true,
// keepClosingSlash: true,
// minifyJS: true,
// minifyCSS: true,
// minifyURLs: true
// }
// return options
// })
//
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
// svgRule.use("vue-svg-loader").loader("vue-svg-loader");
// svgRule.exclude.add(/node_modules/);
svgRule
.test(/\.svg$/)
.include.add(resolve('./src/assets/icon'))
.add(resolve('./node_modules/@x-ui/x-dcloud-ui/lib/assets/icon'))
.add(resolve('./node_modules/@x-apaas/x-dcloud-page-web/lib/assets/icon'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'svg-[name]'
})
config.resolve.symlinks(true)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/shiyutian/apaas-custom-vue-starter.git
git@gitee.com:shiyutian/apaas-custom-vue-starter.git
shiyutian
apaas-custom-vue-starter
apaas-custom-vue-starter
template

搜索帮助