Commit Graph

60 Commits

Author SHA1 Message Date
Alexander Akait 02a1d22db8
refactor: use `eslint-config-webpack` (#19645)
Github Actions / lint (push) Waiting to run Details
Github Actions / validate-legacy-node (push) Waiting to run Details
Github Actions / benchmark (1/4) (push) Waiting to run Details
Github Actions / benchmark (2/4) (push) Waiting to run Details
Github Actions / benchmark (3/4) (push) Waiting to run Details
Github Actions / benchmark (4/4) (push) Waiting to run Details
Github Actions / basic (push) Waiting to run Details
Github Actions / unit (push) Waiting to run Details
Github Actions / integration (10.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (10.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (10.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (12.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (14.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (16.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (18.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (20.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (20.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (lts/*, ubuntu-latest, a, 1) (push) Blocked by required conditions Details
Github Actions / integration (lts/*, ubuntu-latest, b, 1) (push) Blocked by required conditions Details
2025-07-02 15:10:54 +03:00
hai-x bca3d4097c
fix: eliminate unused statements in certain scenarios (#19536) 2025-05-20 14:44:21 +03:00
Ivan Kopeykin af7d788437
feat: add dead control flow check 2025-02-28 17:39:34 +03:00
alexander.akait 93743d233a refactor: code 2024-08-02 19:32:31 +03:00
alexander.akait cc734af66e refactor(types): more 2023-06-22 02:45:07 +03:00
alexander.akait 9894226149 refactor(types): more 2023-06-14 19:46:53 +03:00
Sean Larkin fa4cbf11a1 add more module type constants, use them across codebase 2023-03-31 10:56:32 -07:00
Ivan Kopeykin b2fc854227 fix parser.evaluteExpression api 2022-03-15 15:37:17 +03:00
Tobias Koppers 0bb9c34f1e optional chaining leads to undefined and never null 2020-08-07 16:43:13 +02:00
Tobias Koppers 1eacb07c95 improve optional chaining handling 2020-08-07 14:45:25 +02:00
Ivan Kopeykin 70c0b28d00 add tests, refactor how optional chaining handles 2020-08-07 14:44:54 +02:00
Ivan Kopeykin 18ae4d16d8 add evaluation to optional chaining 2020-08-07 14:43:40 +02:00
Ivan Kopeykin df9ac3a9e7 respect side effects for if statement 2020-07-22 14:21:42 +03:00
Tobias Koppers c8aff62228 improve handling of side effects with evaluation 2020-07-21 13:00:25 +02:00
Tobias Koppers 5876cf6210 improvements, test support check fix 2020-07-21 10:30:11 +02:00
Ivan Kopeykin 5ec7dfd6ac refactor equality comparison, support nullish coalescing in ConstPlugin
- add handleStrictEqualityComparison callback
- add handleAbstractEqualityComparison callback
- rework evaluateIdentifier interface
- add tests
2020-07-21 10:30:10 +02:00
Tobias Koppers 5f4c4662dd rename parsePathQueryFragment to parseResource and add caching 2020-07-06 17:39:52 +02:00
Tobias Koppers 7442a211b9 add support for resource fragments 2020-07-03 17:03:15 +02:00
Tobias Koppers b9c50fdb09 fix jsdoc documentations 2020-04-28 19:42:58 +02:00
Gergely Nagy aea4fd97b5 do not evaluate constants in asm.js, fix IIFE mode detection
fixes #10283
2020-01-22 15:41:45 +01:00
Tobias Koppers a877cd51d1 add presentational dependencies which are cheaper, but allow only templating 2019-10-30 07:49:20 +01:00
Tobias Koppers acff6ec992 move BasicEvaluatedExpression and JavascriptParserHelpers to javascript directory 2019-10-22 09:27:52 +02:00
Tobias Koppers 3cbdb703fc NullFactory is not required 2019-08-07 16:14:03 +02:00
Florent Cailhol 8a10ea3c92 Type 'apply' method of plugins 2018-11-12 14:26:31 +01:00
Tobias Koppers 440be0c53c Merge tag 'v4.23.1' into next
4.23.1
2018-10-25 10:34:31 +02:00
Zhibin Liu 13d1dabd93 [ConstPlugin] fix bug introduced by evaluation of && and || 2018-10-25 10:43:26 +08:00
Tobias Koppers 071062422e Merge tag 'v4.22.0' into next
4.22.0
2018-10-23 16:41:31 +02:00
Zhibin Liu dcd38348e5 fix comments 2018-10-18 14:21:12 +08:00
Zhibin Liu 257e6ec8d6 [ConstPlugin] add support for logical expressions (&& and ||) 2018-10-17 23:12:07 +08:00
Florent Cailhol dcebd57aa4 Replace harmonyInit calls by InitFragments 2018-07-30 22:34:18 +02:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Florent Cailhol 5bc6b8d50e Rename ParserHelpers into JavascriptParserHelpers 2018-07-03 14:08:43 +02:00
Florent Cailhol 6097c5f993 Destructure parser helpers 2018-07-03 14:08:43 +02:00
Florent Cailhol 2a9452e51b Add brackets for multiline if/for statements 2018-05-29 15:45:44 +02:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Mihail Bodrov 52954228ee Remove needless includes 2018-02-01 02:59:08 +03:00
Tobias Koppers e6fb58d1fc
Merge pull request #6273 from ooflorent/fix-4857/unreachable_branches
Eliminate unreachable branches
2018-01-12 10:55:27 +01:00
Florent Cailhol 2cf8660f11 Add tests to improve coverage 2018-01-12 09:23:02 +01:00
Florent Cailhol c9ff97fa7e Eliminate unreachable branches
Webpack does not transpile unreachable branches leaving `import` expressions
in the code. This PR modifies `ConstPlugin` to remove the unreachable branch.

Before:

```js
if (true) { 1 } else { import("a") }
if (false) { import("a") } else { 1 }
true ? 1 : import("a");
false ? import("a") : 1;
```

After:

```js
if (true) { 1 } else {}
if (false) {} else { 1 }
true ? 1 : null;
false ? null : 1;
```
2018-01-11 19:35:24 +01:00
EugeneHlushko 2aab060f26 Refactor: indexOf >< checks to includes 2018-01-11 18:58:39 +02:00
Florent Cailhol 9669c9e013 Use Parser#hooks instead of Tapable#plugin 2017-12-21 09:08:10 +01:00
Florent Cailhol 08ddad2e10 Replace NormalModuleFactory#plugin() calls 2017-12-14 14:42:49 +01:00
Florent Cailhol 36c690d37f Use tapable instead of 'plugin' 2017-12-08 14:23:31 +01:00
Tobias Koppers 00f2b5ede7 advanced module type refactoring
added json type
.mjs default to javascript/esm type
adjusted parser plugins to react on module type
2017-11-11 19:27:19 +01:00
Tobias Koppers f7c2f8e470 Update code style to arrow functions 2017-11-08 11:56:01 +01:00
Tim Sebastian 82eec175af convert more usages of BasicEvaluatedExpression with ParserHelpers 2017-01-21 13:51:35 +11:00
Tobias Koppers 8e69a80847 code linting 2017-01-11 12:29:01 +01:00
Will Mendes ef8c6fb179 refactor(ConstPlugin): upgrade to ES6 (#3845) 2017-01-08 12:07:44 -06:00
Tobias Koppers ec262a4007 refactoring: moved parser instancation into NormalModuleFactory
breaking change: compiler.parser must no longer be used. Use this instead:

``` js
compiler.plugin("compilation", function(compilation, params) {
  params.normalModuleFactory.plugin("parser", function(parser, parserOptions) {
    parser.plugin(/* ... */);
  });
});
```

required for #2978
2016-09-15 00:22:10 +02:00
Tobias Koppers 1c961afe7b fixed small issues with new loader-runner 2015-12-30 16:39:10 +01:00