Commit 1183fded by xinla

--no commit message

1 parent 6684292a
......@@ -25,4 +25,4 @@ linkwe-uniapp/unpackage/dist/
linkwe-uniapp/js_sdk/
linkwe-pc/discard/
node_modules/
vue3-lw-pc/analysis.html
report.html
......@@ -26,3 +26,4 @@ coverage
*.njsproj
*.sln
*.sw?
report.html
\ No newline at end of file
This diff could not be displayed because it is too large.
......@@ -8,7 +8,8 @@
"test": "vite --mode=test",
"build:dev": "vite build --mode=development",
"build:test": "vite build --mode=test",
"preview": "vite preview"
"preview": "vite preview",
"report": "npm run build --report"
},
"dependencies": {
"@element-plus/icons-vue": "^2.1.0",
......
......@@ -81,35 +81,35 @@ export default defineConfig(async ({ command, mode }) => {
drop_debugger: true,
},
},
rollupOptions: {
// vite打包是通过rollup来打包的
output: {
manualChunks: (id) => {
// 可以在这里打印看一下id的值,这里将node_modules中的包打包为 chunk-libs 文件
// console.log(id)
if (id.includes('benz-amr-recorder')) {
return 'benz-amr-recorder'
} else if (id.includes('aliyun-oss-sdk')) {
return 'aliyun-oss-sdk'
} else if (id.includes('echarts')) {
return 'echarts'
} else if (id.includes('element-plus')) {
return 'element-plus'
} else if (id.includes('node_modules')) {
return 'chunk-libs'
} else if (id.includes('src/components')) {
return 'chunk-components'
}
// else if (id.includes('views/')) {
// let first = id.split('views/')[1]
// if (first.includes('/')) {
// return first.match(/(\w+)\/(\w+)/)[0].replace('/', '-') // a/b/c... a-b
// }
// return first.split('.')[0] // a.vue a
// }
},
},
},
// rollupOptions: {
// // vite打包是通过rollup来打包的
// output: {
// manualChunks: (id) => {
// // 可以在这里打印看一下id的值,这里将node_modules中的包打包为 chunk-libs 文件
// // console.log(id)
// if (id.includes('benz-amr-recorder')) {
// return 'benz-amr-recorder'
// } else if (id.includes('aliyun-oss-sdk')) {
// return 'aliyun-oss-sdk'
// } else if (id.includes('echarts')) {
// return 'echarts'
// } else if (id.includes('element-plus')) {
// return 'element-plus'
// } else if (id.includes('node_modules')) {
// return 'chunk-libs'
// } else if (id.includes('src/components')) {
// return 'chunk-components'
// }
// // else if (id.includes('views/')) {
// // let first = id.split('views/')[1]
// // if (first.includes('/')) {
// // return first.match(/(\w+)\/(\w+)/)[0].replace('/', '-') // a/b/c... a-b
// // }
// // return first.split('.')[0] // a.vue a
// // }
// },
// },
// },
},
plugins: [
// '@vue/babel-plugin-jsx',
......@@ -169,13 +169,14 @@ export default defineConfig(async ({ command, mode }) => {
// },
],
}),
rollupPluginVisualizer({
emitFile: false, //使用 emitFile 生成文件。 属性为 true,打包后的分析文件会出现在打包好的文件包下;设置为 false ,则会出现在项目根目录下
filename: 'analysis.html', //生成分析网页文件名
open: true, //在默认用户代理中打开生成的文件
gzipSize: true, //从源代码中收集 gzip 大小并将其显示在图表中
// brotliSize: true, //从源代码中收集 brotli 大小并将其显示在图表中
}),
process.env.npm_config_report &&
rollupPluginVisualizer({
emitFile: false, //使用 emitFile 生成文件。 属性为 true,打包后的分析文件会出现在打包好的文件包下;设置为 false ,则会出现在项目根目录下
filename: 'report.html', //生成分析网页文件名
open: true, //在默认用户代理中打开生成的文件
gzipSize: true, //从源代码中收集 gzip 大小并将其显示在图表中
// brotliSize: true, //从源代码中收集 brotli 大小并将其显示在图表中
}),
],
// optimizedeps: {
// esbuildoptions: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!