mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(webpack): add virtualEntry before main entry
fixes running with the JSC runtime, fixes #9469
This commit is contained in:
24
packages/webpack5/src/helpers/chain.ts
Normal file
24
packages/webpack5/src/helpers/chain.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { ChainedSet } from 'webpack-chain';
|
||||
|
||||
/**
|
||||
* Helper to insert values after a specific item in a ChainedSet.
|
||||
*
|
||||
* @param chainedSet
|
||||
* @param after
|
||||
* @param itemToAdd
|
||||
*/
|
||||
export function chainedSetAddAfter(
|
||||
chainedSet: ChainedSet<any>,
|
||||
after: any,
|
||||
itemToAdd: any
|
||||
) {
|
||||
const values = chainedSet.values();
|
||||
|
||||
if (values.includes(after)) {
|
||||
values.splice(values.indexOf(after) + 1, 0, itemToAdd);
|
||||
} else {
|
||||
values.push(itemToAdd);
|
||||
}
|
||||
|
||||
chainedSet.clear().merge(values);
|
||||
}
|
Reference in New Issue
Block a user