Commit 8301c96
committed
Build: Remove all sourceMappingURL comments when copying Gutenberg files.
The `removeSourceMaps` regex in `copy-gutenberg-build.js` was missing the `/g` (global) flag, so it only stripped the **first** `//# sourceMappingURL=` comment per file.
Bundled files such as the `@wordpress/vips` web worker can contain **multiple** `sourceMappingURL` references from concatenated modules (esbuild builds worker bundles with `sourcemap: true`, and when webpack bundles the module entry point it preserves comments from source modules). This causes the `verify:source-maps` build check to fail:
```
Warning: The build/wp-includes/js/dist/script-modules/vips/worker.js file must not contain a sourceMappingURL.
```
Adding the `/g` flag ensures every occurrence is removed, consistent with the existing `replace:source-maps` Grunt task which already uses the global flag.
Fixes the build failure reported in #10968 (comment).
Developed in #10970.
Props adamsilverstein.
See #64393.
git-svn-id: https://develop.svn.wordpress.org/trunk@61677 602fd350-edb4-49c9-b593-d223f7449a821 parent 265fbb4 commit 8301c96
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
| 925 | + | |
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
| |||
0 commit comments