File tree 2 files changed +19
-1
lines changed
built-in-plugins/command-dev/plugin
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ async function debugProject(options?: any) {
68
68
const dashboardClientPort = await portfinder . getPortPromise ( { port : freePort + 2 } ) ;
69
69
70
70
const pipeConfig = async ( config : webpack . Configuration ) => {
71
+ if ( pri . sourceConfig . disableDllWhenDev || pri . sourceConfig . disableDllWrapWhenDev ) {
72
+ return config ;
73
+ }
71
74
const dllHttpPath = urlJoin (
72
75
`${ globalState . sourceConfig . useHttps ? 'https' : 'http' } ://${ pri . sourceConfig . host } :${ freePort } ` ,
73
76
libraryStaticPath ,
@@ -99,7 +102,9 @@ async function debugProject(options?: any) {
99
102
return scopeAnalyseInfo ;
100
103
} ) ;
101
104
102
- await bundleDlls ( { dllOutPath, dllFileName, dllMainfestName } ) ;
105
+ if ( ! pri . sourceConfig . disableDllWhenDev ) {
106
+ await bundleDlls ( { dllOutPath, dllFileName, dllMainfestName } ) ;
107
+ }
103
108
104
109
if ( globalState . sourceConfig . useHttps ) {
105
110
logInfo ( 'you should set chrome://flags/#allow-insecure-localhost, to trust local certificate.' ) ;
@@ -315,6 +320,9 @@ function debugProjectPrepare(dashboardClientPort: number) {
315
320
if ( ! pri . isDevelopment ) {
316
321
return config ;
317
322
}
323
+ if ( pri . sourceConfig . disableDllWhenDev ) {
324
+ return config ;
325
+ }
318
326
319
327
config . plugins . push (
320
328
new webpack . DllReferencePlugin ( {
Original file line number Diff line number Diff line change @@ -353,6 +353,16 @@ export class ProjectConfig {
353
353
*/
354
354
public disableDashboard : boolean ;
355
355
356
+ /**
357
+ * Disable dll in dev mode
358
+ */
359
+ public disableDllWhenDev : boolean ;
360
+
361
+ /**
362
+ * If disable, pri will not wrap dllScript to entry js in dev mode, your should wrap dllScript to html by yourself
363
+ */
364
+ public disableDllWrapWhenDev : boolean ;
365
+
356
366
/**
357
367
* Publish config for npm publish
358
368
*/
You can’t perform that action at this time.
0 commit comments