@atlaspack/packager-js 2.14.5-canary.136 → 2.14.5-canary.138
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.js +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
|
|
@@ -187,10 +187,14 @@ class ScopeHoistingPackager {
|
|
|
187
187
|
if (this.isAsyncBundle) {
|
|
188
188
|
// In async bundles we don't want the main entry to execute until we require it
|
|
189
189
|
// as there might be dependencies in a sibling bundle that hasn't loaded yet.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
if ((0, _featureFlags().getFeatureFlag)('supportWebpackChunkName')) {
|
|
191
|
+
entries = [];
|
|
192
|
+
} else {
|
|
193
|
+
entries = entries.filter(a => {
|
|
194
|
+
var _mainEntry;
|
|
195
|
+
return a.id !== ((_mainEntry = mainEntry) === null || _mainEntry === void 0 ? void 0 : _mainEntry.id);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
194
198
|
mainEntry = null;
|
|
195
199
|
}
|
|
196
200
|
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.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.138+eda07caaf",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
20
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
21
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
22
|
-
"@atlaspack/types": "2.14.5-canary.
|
|
23
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-canary.206+eda07caaf",
|
|
19
|
+
"@atlaspack/feature-flags": "2.14.1-canary.206+eda07caaf",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-canary.138+eda07caaf",
|
|
21
|
+
"@atlaspack/rust": "3.2.1-canary.138+eda07caaf",
|
|
22
|
+
"@atlaspack/types": "2.14.5-canary.138+eda07caaf",
|
|
23
|
+
"@atlaspack/utils": "2.14.5-canary.138+eda07caaf",
|
|
24
24
|
"@parcel/source-map": "^2.1.1",
|
|
25
25
|
"globals": "^13.2.0",
|
|
26
26
|
"nullthrows": "^1.1.1",
|
|
27
27
|
"outdent": "^0.8.0"
|
|
28
28
|
},
|
|
29
29
|
"type": "commonjs",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "eda07caafd2ebb814bbdbfd0ec12fa63124e213f"
|
|
31
31
|
}
|
|
@@ -210,7 +210,11 @@ export class ScopeHoistingPackager {
|
|
|
210
210
|
if (this.isAsyncBundle) {
|
|
211
211
|
// In async bundles we don't want the main entry to execute until we require it
|
|
212
212
|
// as there might be dependencies in a sibling bundle that hasn't loaded yet.
|
|
213
|
-
|
|
213
|
+
if (getFeatureFlag('supportWebpackChunkName')) {
|
|
214
|
+
entries = [];
|
|
215
|
+
} else {
|
|
216
|
+
entries = entries.filter((a) => a.id !== mainEntry?.id);
|
|
217
|
+
}
|
|
214
218
|
mainEntry = null;
|
|
215
219
|
}
|
|
216
220
|
|