@atlaspack/packager-js 2.18.3-typescript-bc4459c37.0 → 2.19.1-typescript-5ad950d33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/lib/ScopeHoistingPackager.js +8 -4
- package/package.json +8 -8
- package/src/ScopeHoistingPackager.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaspack/packager-js
|
|
2
2
|
|
|
3
|
+
## 2.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#721](https://github.com/atlassian-labs/atlaspack/pull/721) [`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd) Thanks [@benjervis](https://github.com/benjervis)! - Add support for bundle merging based on `webpackChunkName` comments.
|
|
8
|
+
|
|
9
|
+
Adding a `webpackChunkName` comment to an import will allow the bundler to merge multiple imports into a single bundle.
|
|
10
|
+
|
|
11
|
+
e.g.:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import(/* webpackChunkName: "my-chunk" */ './my-module');
|
|
15
|
+
import(/* webpackChunkName: "my-chunk" */ './another-module');
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This can be enabled with the feature flag `supportWebpackChunkName`.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
|
|
23
|
+
- @atlaspack/feature-flags@2.20.0
|
|
24
|
+
- @atlaspack/types@2.15.11
|
|
25
|
+
- @atlaspack/utils@2.17.3
|
|
26
|
+
- @atlaspack/plugin@2.14.21
|
|
27
|
+
|
|
3
28
|
## 2.18.2
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -191,10 +191,14 @@ class ScopeHoistingPackager {
|
|
|
191
191
|
if (this.isAsyncBundle) {
|
|
192
192
|
// In async bundles we don't want the main entry to execute until we require it
|
|
193
193
|
// as there might be dependencies in a sibling bundle that hasn't loaded yet.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
if ((0, _featureFlags().getFeatureFlag)('supportWebpackChunkName')) {
|
|
195
|
+
entries = [];
|
|
196
|
+
} else {
|
|
197
|
+
entries = entries.filter(a => {
|
|
198
|
+
var _mainEntry;
|
|
199
|
+
return a.id !== ((_mainEntry = mainEntry) === null || _mainEntry === void 0 ? void 0 : _mainEntry.id);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
198
202
|
mainEntry = null;
|
|
199
203
|
}
|
|
200
204
|
let needsBundleQueue = this.shouldBundleQueue(this.bundle);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.1-typescript-5ad950d33.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"node": ">= 16.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/diagnostic": "2.14.2-typescript-
|
|
20
|
-
"@atlaspack/feature-flags": "2.
|
|
21
|
-
"@atlaspack/plugin": "2.14.
|
|
22
|
-
"@atlaspack/rust": "3.4.2-typescript-
|
|
23
|
-
"@atlaspack/types": "2.15.
|
|
24
|
-
"@atlaspack/utils": "2.17.
|
|
19
|
+
"@atlaspack/diagnostic": "2.14.2-typescript-5ad950d33.0",
|
|
20
|
+
"@atlaspack/feature-flags": "2.20.1-typescript-5ad950d33.0",
|
|
21
|
+
"@atlaspack/plugin": "2.14.22-typescript-5ad950d33.0",
|
|
22
|
+
"@atlaspack/rust": "3.4.2-typescript-5ad950d33.0",
|
|
23
|
+
"@atlaspack/types": "2.15.12-typescript-5ad950d33.0",
|
|
24
|
+
"@atlaspack/utils": "2.17.4-typescript-5ad950d33.0",
|
|
25
25
|
"@parcel/source-map": "^2.1.1",
|
|
26
26
|
"globals": "^13.2.0",
|
|
27
27
|
"nullthrows": "^1.1.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "5ad950d33a5f2255ebeb10c04a2e84c346e2de85"
|
|
35
35
|
}
|
|
@@ -220,7 +220,11 @@ export class ScopeHoistingPackager {
|
|
|
220
220
|
if (this.isAsyncBundle) {
|
|
221
221
|
// In async bundles we don't want the main entry to execute until we require it
|
|
222
222
|
// as there might be dependencies in a sibling bundle that hasn't loaded yet.
|
|
223
|
-
|
|
223
|
+
if (getFeatureFlag('supportWebpackChunkName')) {
|
|
224
|
+
entries = [];
|
|
225
|
+
} else {
|
|
226
|
+
entries = entries.filter((a) => a.id !== mainEntry?.id);
|
|
227
|
+
}
|
|
224
228
|
mainEntry = null;
|
|
225
229
|
}
|
|
226
230
|
|