Commit Graph

107 Commits

Author SHA1 Message Date
Tobias Koppers b9c6691ff5 bugfixes, external assets 2021-12-03 16:23:09 +01:00
Tobias Koppers 8ae9507196 add support for url() in css 2021-12-03 08:46:24 +01:00
Tobias Koppers 77b5589c1a css generation and hmr 2021-12-03 08:46:22 +01:00
Ivan Kopeykin c106e430a8 fix RuntimeTemplate 2021-11-29 23:00:37 +03:00
Tobias Koppers bcd2400fb5 improve cost computation and add explanation 2021-11-26 09:13:14 +01:00
Tobias Koppers e889c7bec5 Merge branch 'main' into improve-runtime-template 2021-11-26 08:46:49 +01:00
Ivan Kopeykin edeaa6eb82 use "safe" global object 2021-11-23 20:40:03 +03:00
Ivan Kopeykin 2b87b64de9 rename to runtimeTemplate.concatenation 2021-11-22 18:11:03 +03:00
Ivan Kopeykin 1bdc48e32b improve runtime template
- add optional chaining support check,
- add template string support check,
- use template string in asset generator
2021-11-21 21:18:11 +03:00
Ivan Kopeykin 27411f8f0f add pure notations to Object calls
/*#__PURE__*/ notations should help minimizers to drop unused Object(...) calls
2021-10-17 11:06:14 +03:00
Tobias Koppers 4da99d8254 add `module` library support, test and example
add test cases for `experiments.outputModule`
2021-06-23 14:49:14 +02:00
Tobias Koppers 7f4ce2cf1a add expressionFunction helper to choose shortest variant when return value is not relevant 2021-03-15 15:40:30 +01:00
Tobias Koppers 85a6eee0bb move parser.filename back to generator.filename 2021-03-11 17:19:11 +01:00
Tobias Koppers 495cabb94d improve TLA consistency 2021-01-29 13:51:32 +01:00
Tobias Koppers 48571c663f add selective runtime requirements from startup logic which doesn't prevent inlining modules
avoid using startup function for grab data from preexecuted chunks
2020-12-11 14:36:48 +01:00
Tobias Koppers 35363408c6 fix newly found eslint problems 2020-11-26 11:13:17 +01:00
Tobias Koppers cbcd459d19 fix conflicting real imports and type imports 2020-11-26 10:02:59 +01:00
Tobias Koppers ac15f06f2a improve handling of exported Promises 2020-11-16 20:24:54 +01:00
Tobias Koppers 590aacc2ae make visible exports from non-harmony modules more consistent
fixes #11995
2020-11-16 17:19:36 +01:00
Tobias Koppers f2ed7ca3e3 fix crash because for invalid type 2020-10-27 06:50:10 +01:00
Tobias Koppers 19f51535ca merge multiple import statements with different conditions correctly
improve hashing when conditional runtime evaluation is involved
add test cases
2020-10-27 06:48:54 +01:00
Tobias Koppers 7661ad868a generate code that executes depending on runtime
fixes #11770
2020-10-27 06:30:49 +01:00
Tobias Koppers 2ec90b3687 add asset info for `sourceFilename` and `javascriptModule` 2020-10-22 10:47:23 +02:00
Ivan Kopeykin 49009486df support undo path 2020-09-16 23:20:44 +03:00
Tobias Koppers 2c00413b26 rename supportsAsyncImport -> supportsDynamicImport 2020-09-11 23:13:10 +02:00
Tobias Koppers bbdb33a5cf rename output.environment.import -> output.environment.dynamicImport 2020-09-11 23:11:02 +02:00
Tobias Koppers 7e85649492 improve target options
infer target properties from different targets and fill defaults from that

custom targets can now be created via `target: false` and a plugin (similar to the other options)

add stubs from universal chunk/wasm loading and module chunk format

add externalsPresets.electron and externalsPresets.electronRenderer

node.__file/dirname: "eval-only"
2020-09-10 11:42:09 +02:00
Tobias Koppers 48010fb955 replace output.ecmaVersion with output.environment and more detailed flags 2020-09-10 11:12:28 +02:00
Tobias Koppers 962199c288 nitpicks 2020-09-01 11:15:52 +02:00
Ivan Kopeykin efb8211bcf refactor: use ternary operator instead of if-else 2020-08-29 17:02:10 +03:00
Ivan Kopeykin a3fc25cadb refactor asiSafe flag in dependencies 2020-08-29 17:00:03 +03:00
Ivan Kopeykin 35c56e67ae refactor how asi handled
- add asiSafeExpression helper for JavascriptParser
- use asiSafe flag in DefinePlugin
- try to use (...) instead of Object()
2020-08-28 19:46:56 +03:00
Tobias Koppers 6928a65911 conflict-free handling of global in import-script
use destructuring when available
2020-08-28 11:27:33 +02:00
Tobias Koppers 71cf7f4dc8 add support for reexporting in CommonJS
and necessary refactoring + fixes for that
2020-08-17 21:32:47 +02:00
Tobias Koppers 163e7674a0 track the target binding of harmony reexports
display target binding in module info header
check conflicting star exports (fixes #7562) when statically known
2020-08-11 20:13:01 +02:00
Tobias Koppers 2bf2417fe0 improve tests and fix fake type 2020-08-07 17:34:36 +02:00
Robert Lange 834fc01b21 fix: dynamic import promise externals 2020-08-04 19:43:05 +02:00
Tobias Koppers e16bdfda6c refactor used exports analysis, hashing, code generation, optimizations
to keep track of runtimes, used exports depending on runtime

modules can have different hashes and generated code depending on runtime
chunks are only considered as equal for MergeDuplicateChunks and SplitChunks when exports used in contained modules are equal
added `optimization.usedExports: "global"` to opt-out from used exports analysis per runtime
added `splitChunks.usedExports` and `splitChunks.cacheGroups[x].usedExports` to enable/disable used exports comparing for modules
`splitChunks.usedExports` defaults to `true` in production
2020-07-27 22:40:44 +02:00
Tobias Koppers edf03440ba add SharePlugin
let ModuleFederationPlugin use the SharePlugin
update container test cases to new behavior
2020-05-26 17:11:21 +02:00
Tobias Koppers 2fc44c2343 add share plugin 2020-05-26 00:46:09 +02:00
Tobias Koppers a468cbbd2e add provide shared module plugin 2020-05-23 16:08:51 +02:00
Tobias Koppers a66290a15f add support for async externals
add `promise` external
add `import` external (uses import())

add `output.importFunctionName` option to change the `import()` function name

allow for inline external type when using arrays

fix some typings

fix namespace object behavior when using system external and accessing nested property
fix interop behavior for async dynamic modules
2020-05-19 17:25:43 +02:00
Tobias Koppers a643278726 refactor exports info logic always represent exports object instead of namespace object
improve test case
2020-04-22 21:01:29 +02:00
evilebottnawi dafa4cd69a chore: setup cspell 2020-03-12 19:51:26 +03:00
Tobias Koppers d0a33e41c9
Merge pull request #10424 from lcy930323/bugfix/missing_module_template
fix(template): Syntax error caused by runtime template
2020-02-26 08:35:53 +01:00
Sunlight 1e9ee8ab0f fix(template): Syntax error caused by runtime template 2020-02-22 14:20:30 +08:00
Sunlight 13f7c66629 fix(template): Syntax error caused by runtime template 2020-02-21 14:44:44 +08:00
Tobias Koppers 6477ca56f8 Split options defaulting in normalization and defaults
Apply defaults after plugins are applied to allow plugins to feature their own defaults.
This allows to make preset plugins.
2020-02-17 19:12:54 +01:00
Tobias Koppers 782e4535ac Refactor how exportsType work
add flagged exportsType for __esModule flagged
add getExportsType to merge strict with exportsType
move CommonJsStuffPlugin into CommonJsPlugin
split CommonJsPlugin into imports and exports part
enable minimal tree shaking for CommonJs imports and exports
2019-12-06 11:13:08 +01:00
Tobias Koppers 1d3e1b4208 shorter minimized code for import() 2019-12-06 11:12:04 +01:00