Commit Graph

122 Commits

Author SHA1 Message Date
Qingyu Wang 8ab85e29bb feat: implement `module.generator.json.JSONParse`
For large `.json` modules, webpack will generate `JSON.parse` by default for
better performance. But there are some circumstances that `JSON.parse` is not a
good choice (e.g.: when doing AOT compilation).

Thus, a new generator option `module.generator.json.JSONParse` is added to
disable generating `JSON.parse` for `.json` module.

The default value is kept as `true` and can be opt-out by custom rules.

fix: #19319
2025-03-13 22:24:10 +08:00
Tim Fish 7f8802a8da Merge remote-tracking branch 'upstream/main' into feat/inject-debug-ids 2024-11-20 16:03:49 -05:00
alexander.akait 4d95b0df1d fix: concatenation 2024-11-15 18:59:14 +03:00
Tim Fish 5821a9b8ea Merge remote-tracking branch 'upstream/main' into feat/inject-debug-ids 2024-11-14 13:50:23 +00:00
alexander.akait 0016a1a075 fix: sync and async wasm generation 2024-11-14 06:34:49 +03:00
Tim Fish 6f5c6b9778 Use debugids 2024-11-13 14:54:03 +00:00
Tim Fish 55af197bdf Add top level debug-ids option 2024-11-11 16:22:06 +01:00
alexander.akait 5e09d0e05f feat: added `url` and `import` options for CSS 2024-11-01 18:43:21 +03:00
alexander.akait 636b5c5dba fix: types 2024-10-02 00:18:10 +03:00
fi3ework fe169983cb udpate tests 2024-09-20 02:05:41 +08:00
fi3ework 8354f16073 update pr 2024-09-20 00:24:31 +08:00
fi3ework 7bc06a3295 feat: add new optimization.entryIife config 2024-09-19 01:20:47 +08:00
fi3ework ce24bb03c2 feat: add new external type "module-import" 2024-08-05 17:03:09 +08:00
ahabhgk 9c9cb0bcdd feat: override strict for javascript module 2024-07-03 16:32:36 +08:00
ArcanoxDragon b6f164b2a9 Add a generator option for asset modules to prevent automatic conversion to Buffer (which causes source maps to be lost). Fixes #18438 2024-06-11 14:25:05 -05:00
alexander.akait ba4db838e9 feat: added `with` ruleset rule 2024-06-10 20:40:50 +03:00
ahabhgk 7ff0a7a13e feat: support css esModule generator options 2024-04-26 14:53:52 +08:00
ahabhgk bf2571b957 remove exportsConvention for css 2024-04-20 12:10:56 +08:00
alexander.akait bfe7a71f85 feat: support `node:` prefix for Node.js core modules in runtime code 2024-04-11 19:16:15 +03:00
alexander.akait 9c61ce5694 test: fix 2024-03-25 16:07:02 +03:00
alexander.akait eae0442ff1 refactor: rebase 2024-03-11 15:36:22 +03:00
alexander.akait cf891a4164 fix: resolve's plugins types 2024-03-11 15:35:28 +03:00
ahabhgk 074fccb38b feat: add css head data compression 2024-03-06 14:29:57 +08:00
ahabhgk d4dc533fc3 feat: support css local ident name 2024-02-22 20:10:45 +08:00
ahabhgk f892acf0a2 use dashes case 2024-02-21 19:51:03 +08:00
ahabhgk d4a5766bbe feat: support css exports convention 2024-02-21 16:00:24 +08:00
alexander.akait 818b8ecfb6 refactor: rebase 2024-01-20 20:48:19 +03:00
ahabhgk 92b33021ff feat: css named exports parser options 2024-01-16 00:23:07 +08:00
ahabhgk a55f34349a feat: add warning for asyncModule 2024-01-14 18:11:12 +08:00
ahabhgk 2715265126 wip 2024-01-12 15:57:52 +08:00
Alexander Yamakin ce6b0618ff
Merge branch 'main' into feature-14072 2024-01-09 02:59:32 +03:00
Sayan751 7d8799ac4b
added unmanagedPaths to snapshot options 2023-10-04 23:28:11 +02:00
alexander.akait b2a09daa21 refactor: rebase 2023-06-14 18:26:13 +03:00
alexander.akait 9c54d4409c refactor: rebase 2023-06-12 22:03:36 +03:00
alexander.akait 83090d2189 refactor: avoid boolean 2023-06-12 21:56:08 +03:00
alexander.akait 00b68588cf test: update 2023-06-12 21:56:06 +03:00
YunfeiHe 5cac4f9f84 Update WebpackOptions 2023-06-06 11:58:38 +08:00
alexander.akait 9c7693bb4a refactor: rebase 2023-05-31 18:01:14 +03:00
alexander.akait 8ac01ef817 refactor: rebase 2023-05-25 03:30:44 +03:00
Michael Zlatkovsky 83d14b13e1 Merge remote-tracking branch 'origin/main' into zlatkovsky/trusted-types-options 2023-05-02 14:58:15 -07:00
Michael Zlatkovsky 2203e24900 Add option to continue on trusted-types policy-creation failure
Webpack already allows for specifying a trusted-types policy name. However, its current implementation is such that if a call to trustedTypes.createPolicy fails, the code will immediately stop executing. This isn't necessarily desirable, as an application could be in the early phases of rolling out trusted types, and thus have the CSP rule for trusted-types LibraryA LibraryB etc, BUT have require-trusted-types-for 'script' be in "report only" mode (Content-Security-Policy-Report-Only). In such a configuration, and when the webpacked code is dynamically-loaded into an application, adding the policy name to the webpack config will break old versions.

This PR keeps the original behavior, but introduces a new option for onPolicyCreationFailure: "continue" | "stop" (with "stop" remaining the default). If a developer chooses the "continue" option, the policy-creation will be wrapped in a try/catch. There is no security risk to this, since for host applications that DO have strict enforcement of trusted-types, the code will simply fail when the dangerous sink is used (e.g., when doing parseFromString). And likewise, wrapping in try/catch and doing nothing on catch is OK, because the code already deals with the possibility of the trustedTypes API not being available on the browser.
2023-05-02 10:12:56 -07:00
alexander.akait 3498d5fb97 chore: update types 2023-05-02 12:55:44 +03:00
Sam Brett f5d368efa6 feat: ignoreBrowserWarnings option to ignore browser console warnings 2023-04-20 10:51:37 -07:00
Ivan Kopeykin e6c7a57e33 Merge branch 'main' into feature/errors-warnings-space 2023-04-12 18:08:16 +03:00
alexander.akait c447b49c47 chore: update schemas 2023-04-07 03:11:52 +03:00
alexander.akait c7e2be9fca chore: update terser 2023-04-07 02:25:43 +03:00
Ivan Kopeykin e4a024f9b1 Merge branch 'main' into feature/errors-warnings-space
# Conflicts:
#	schemas/WebpackOptions.check.js
2023-04-06 11:43:05 +03:00
long76 595e1cb5ba fix WebpackOptions.check.js 2023-03-25 14:06:56 +03:00
long76 c5ac0d39c4
Merge branch 'main' into patch-1 2023-03-25 13:53:20 +03:00
long76 8c20d74992 replace globalObject to amdContainer, add tests 2023-01-02 16:32:11 +03:00