@@ -2,7 +2,12 @@ import * as fs from 'fs-extra';
2
2
import * as path from 'path' ;
3
3
import * as webpack from 'webpack' ;
4
4
import { globalState } from '../../../utils/global-state' ;
5
- import { hasNodeModules , hasNodeModulesModified } from '../../../utils/project-helper' ;
5
+ import {
6
+ hasNodeModules ,
7
+ hasNodeModulesModified ,
8
+ hasExtraVendorsChanged ,
9
+ hasPackageChanged ,
10
+ } from '../../../utils/project-helper' ;
6
11
import getWebpackDllConfig from './webpack-dll-config' ;
7
12
8
13
export const dllFileName = 'main.dll.js' ;
@@ -48,10 +53,15 @@ function runCompiler(compiler: webpack.Compiler) {
48
53
}
49
54
50
55
/**
51
- * Bundle dlls if node_modules changed, or dlls not exist.
56
+ * Bundle dlls when node_modules changed, dlls not exist, extraDll changed, or package to dev changed;
52
57
*/
53
58
export async function bundleDlls ( ) {
54
- if ( ( hasNodeModules ( ) && hasNodeModulesModified ( ) ) || ! fs . existsSync ( path . join ( dllOutPath , dllFileName ) ) ) {
59
+ if (
60
+ hasPackageChanged ( ) ||
61
+ hasExtraVendorsChanged ( ) ||
62
+ ( hasNodeModules ( ) && hasNodeModulesModified ( ) ) ||
63
+ ! fs . existsSync ( path . join ( dllOutPath , dllFileName ) )
64
+ ) {
55
65
await runDllWebpack ( { dllOutPath, dllFileName, dllMainfestName } ) ;
56
66
}
57
67
}
0 commit comments