2 Star 9 Fork 9

Jerry K / antv-x6-vue2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Jerry K 提交于 2022-06-04 17:36 . refactor: vue-node shape
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
// 修改 src 为 examples
pages: {
index: {
entry: "examples/main.js",
template: "public/index.html",
filename: "index.html",
},
},
publicPath: './',
outputDir: 'webpage',
runtimeCompiler: true,
chainWebpack(config) {
// 配置svg
config.module
.rule('svg')
.exclude.add(resolve('packages/x6/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('packages/x6/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
// 压缩处理
config.plugins.push(
new UglifyJsPlugin({
uglifyOptions: {
warnings: false,
},
sourceMap: false,
parallel: true, // 使用多进程并行运行来提高构建速度。默认并发运行数:os.cpus().length - 1。
})
);
}
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
});
}
};
JavaScript
1
https://gitee.com/g0ngjie/antv-x6-vue2.git
git@gitee.com:g0ngjie/antv-x6-vue2.git
g0ngjie
antv-x6-vue2
antv-x6-vue2
master

搜索帮助