File tree Expand file tree Collapse file tree 2 files changed +760
-220
lines changed
Expand file tree Collapse file tree 2 files changed +760
-220
lines changed Original file line number Diff line number Diff line change 22
33import common from './rollup'
44import nodeResolve from '@rollup/plugin-node-resolve'
5+ import commonjs from '@rollup/plugin-commonjs'
56
67const isProd = process . env . NODE_ENV === 'production'
78export default {
@@ -12,13 +13,19 @@ export default {
1213 // 如果不同时使用 export 与 export default 可打开legacy
1314 // legacy: true,
1415 banner : common . banner
16+ // sourcemap: isProd
1517 } ,
16- external : common . external ,
18+ // 小程序不支持包内require别的包,必须把别的包也一起打包进来
19+ external : isProd ? [ ] : common . external ,
1720 plugins : [
1821 nodeResolve ( {
1922 main : true ,
2023 extensions : [ '.ts' , '.js' ]
2124 } ) ,
25+ commonjs ( {
26+ include : / n o d e _ m o d u l e s / ,
27+ transformMixedEsModules : true
28+ } ) ,
2229 common . getCompiler ( {
2330 tsconfigOverride : { compilerOptions : { declaration : true } } ,
2431 useTsconfigDeclarationDir : true
You can’t perform that action at this time.
0 commit comments