Skip to content

Commit 8c9ed2d

Browse files
author
xylona.lxy
committed
feat: extradll
1 parent 71a6c43 commit 8c9ed2d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/built-in-plugins/command-dev/plugin/webpack-dll-config.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ const stats = {
1919
hash: false,
2020
};
2121

22+
const vendors = [
23+
'react',
24+
'react-dom',
25+
'lodash',
26+
'highlight.js',
27+
'react-router',
28+
'history',
29+
`${PRI_PACKAGE_NAME}/client`,
30+
...(globalState.sourceConfig.extraVendors ?? []),
31+
];
32+
2233
export default (opts: IOptions) => {
2334
const result: webpack.Configuration = {
2435
mode: 'development',
@@ -28,7 +39,8 @@ export default (opts: IOptions) => {
2839
(all, fn) => {
2940
return fn(all);
3041
},
31-
['react', 'react-dom', 'lodash', 'highlight.js', 'react-router', 'history', `${PRI_PACKAGE_NAME}/client`],
42+
// ['react', 'react-dom', 'lodash', 'highlight.js', 'react-router', 'history', `${PRI_PACKAGE_NAME}/client`],
43+
vendors,
3244
),
3345
},
3446

src/utils/define.ts

+5
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ export class ProjectConfig {
281281
* entries for component build
282282
*/
283283
componentEntries: IEntryPath;
284+
285+
/*
286+
* extra vendors defined in priConfig, which you dont want to rebundle during project rebuid
287+
*/
288+
public extraVendors: string[] = [];
284289
}
285290

286291
export type SetPipe = (pipeName: string, callback: PipeCallback) => void;

0 commit comments

Comments
 (0)