Commit 1183fded by xinla

--no commit message

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