Commit 616a43b4 by 张杰

优化打包

1 parent 9ec614da
const path = require('path') const path = require('path')
const { name, port } = require("./package"); const { name, port } = require("./package");
function resolve (dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
...@@ -13,6 +13,7 @@ module.exports = { ...@@ -13,6 +13,7 @@ module.exports = {
outputDir: "dist", outputDir: "dist",
assetsDir: "static", assetsDir: "static",
filenameHashing: true, filenameHashing: true,
productionSourceMap: false,
devServer: { devServer: {
overlay: { overlay: {
warning: false, warning: false,
...@@ -49,7 +50,7 @@ module.exports = { ...@@ -49,7 +50,7 @@ module.exports = {
configureWebpack: { configureWebpack: {
output: { output: {
// 微应用的包名,这里与主应用中注册的微应用名称一致 // 微应用的包名,这里与主应用中注册的微应用名称一致
library: `${name}-[name]`, library: `${name}-[name]`,
// 将你的 library 暴露为所有的模块定义下都可运行的方式 // 将你的 library 暴露为所有的模块定义下都可运行的方式
libraryTarget: 'umd', libraryTarget: 'umd',
// 按需加载相关 // 按需加载相关
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!