@modern-js/utils 1.1.0 → 1.1.4-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +27 -66
- package/dist/js/modern/alias.js +10 -10
- package/dist/js/modern/compatRequire.js +11 -0
- package/dist/js/modern/constants.js +51 -3
- package/dist/js/modern/getEntryOptions.js +15 -6
- package/dist/js/modern/is/type.js +3 -0
- package/dist/js/modern/logger.js +2 -2
- package/dist/js/modern/monorepo.js +2 -2
- package/dist/js/modern/runtimeExports.js +5 -2
- package/dist/js/node/alias.js +10 -10
- package/dist/js/node/compatRequire.js +16 -2
- package/dist/js/node/constants.js +58 -6
- package/dist/js/node/getEntryOptions.js +16 -6
- package/dist/js/node/is/type.js +5 -0
- package/dist/js/node/logger.js +2 -2
- package/dist/js/node/monorepo.js +2 -2
- package/dist/js/node/runtimeExports.js +8 -2
- package/dist/js/treeshaking/alias.js +9 -9
- package/dist/js/treeshaking/compatRequire.js +14 -0
- package/dist/js/treeshaking/constants.js +51 -3
- package/dist/js/treeshaking/formatWebpackMessages.js +1 -1
- package/dist/js/treeshaking/getEntryOptions.js +16 -5
- package/dist/js/treeshaking/is/type.js +4 -1
- package/dist/js/treeshaking/logger.js +3 -3
- package/dist/js/treeshaking/monorepo.js +2 -2
- package/dist/js/treeshaking/runtimeExports.js +8 -2
- package/dist/types/compatRequire.d.ts +2 -1
- package/dist/types/constants.d.ts +22 -2
- package/dist/types/getEntryOptions.d.ts +1 -1
- package/dist/types/is/type.d.ts +2 -1
- package/dist/types/runtimeExports.d.ts +1 -1
- package/package.json +5 -4
- package/src/alias.ts +7 -7
- package/src/compatRequire.ts +15 -0
- package/src/constants.ts +39 -2
- package/src/getEntryOptions.ts +23 -4
- package/src/is/type.ts +4 -0
- package/src/runtimeExports.ts +12 -1
- package/tests/getEntryOptions.test.ts +11 -0
@@ -15,6 +15,17 @@ describe('get entry options', () => {
|
|
15
15
|
).toEqual('a');
|
16
16
|
});
|
17
17
|
|
18
|
+
test(`should compatible with main entry using packageName as key`, () => {
|
19
|
+
expect(
|
20
|
+
getEntryOptions(
|
21
|
+
'main',
|
22
|
+
'default value',
|
23
|
+
{ 'package-name': 'a' },
|
24
|
+
'package-name',
|
25
|
+
),
|
26
|
+
).toEqual('a');
|
27
|
+
});
|
28
|
+
|
18
29
|
expect(
|
19
30
|
getEntryOptions(
|
20
31
|
'page-a',
|