File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ export default class Bundler {
143
143
) {
144
144
exportStore . push ( {
145
145
input : filePath ,
146
+
146
147
output : {
147
148
file : path . resolve ( this . entryPath , config . outDir , newRelativePath ) ,
148
149
format : config . format ,
@@ -151,13 +152,18 @@ export default class Bundler {
151
152
sourcemap : config . sourcemap ,
152
153
globals : this . config . globals ,
153
154
} ,
155
+
154
156
plugins : config . uglify ? this . pluginsWithUglifier : this . plugins ,
155
- external : config . externals ,
156
157
157
- // external: (id, parent, isResolved) => {
158
- // console.log(id);
159
- // return config.format === 'cjs';
160
- // },
158
+ external : ( id , parent , isResolved ) => {
159
+ if ( config . format === 'cjs' ) {
160
+ return true ;
161
+ } else if ( config . externals . length > 0 && config . externals . includes ( id ) ) {
162
+ return true ;
163
+ } else {
164
+ return false ;
165
+ }
166
+ } ,
161
167
watch : this . config . watch ,
162
168
} ) ;
163
169
}
You can’t perform that action at this time.
0 commit comments