Skip to content

Commit cd31df7

Browse files
committed
feat: support disableDllWhenDev and disableDllWrapWhenDev configuration
1 parent 10ff9a9 commit cd31df7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/built-in-plugins/command-dev/plugin/project-dev.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ async function debugProject(options?: any) {
6868
const dashboardClientPort = await portfinder.getPortPromise({ port: freePort + 2 });
6969

7070
const pipeConfig = async (config: webpack.Configuration) => {
71+
if (pri.sourceConfig.disableDllWhenDev || pri.sourceConfig.disableDllWrapWhenDev) {
72+
return config;
73+
}
7174
const dllHttpPath = urlJoin(
7275
`${globalState.sourceConfig.useHttps ? 'https' : 'http'}://${pri.sourceConfig.host}:${freePort}`,
7376
libraryStaticPath,
@@ -99,7 +102,9 @@ async function debugProject(options?: any) {
99102
return scopeAnalyseInfo;
100103
});
101104

102-
await bundleDlls({ dllOutPath, dllFileName, dllMainfestName });
105+
if (!pri.sourceConfig.disableDllWhenDev) {
106+
await bundleDlls({ dllOutPath, dllFileName, dllMainfestName });
107+
}
103108

104109
if (globalState.sourceConfig.useHttps) {
105110
logInfo('you should set chrome://flags/#allow-insecure-localhost, to trust local certificate.');
@@ -315,6 +320,9 @@ function debugProjectPrepare(dashboardClientPort: number) {
315320
if (!pri.isDevelopment) {
316321
return config;
317322
}
323+
if (pri.sourceConfig.disableDllWhenDev) {
324+
return config;
325+
}
318326

319327
config.plugins.push(
320328
new webpack.DllReferencePlugin({

src/utils/define.ts

+10
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,16 @@ export class ProjectConfig {
353353
*/
354354
public disableDashboard: boolean;
355355

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+
356366
/**
357367
* Publish config for npm publish
358368
*/

0 commit comments

Comments
 (0)