Commit Graph

45 Commits

Author SHA1 Message Date
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
Tobias Koppers dd73373d86 fixed #1044 and fixed #1244 2015-07-22 23:40:46 +02:00
Tobias Koppers f7d799adb4 rebeautify without spacing after keyword 2015-07-16 00:19:23 +02:00
Avi Haiat 0a340f2b1a feat(app): Beautify all lib files 2015-07-13 01:20:09 +03:00
Avi Haiat daff7440a6 feat(app): Fix some obvious lint errors and warnings 2015-07-08 15:52:41 +03:00
Tobias Koppers d3a7994e35 expose `loc` for every Dependency 2015-05-10 18:31:58 +02:00
Tobias Koppers cebd3b9722 added linting 2015-04-23 23:55:50 +02:00
Tobias Koppers a37948d114 added options.define, evaluate conditionals, fixes #99 2013-09-13 11:17:57 +02:00
Tobias Koppers c88bce3b08 use variable for __resourceQuery 2013-02-17 10:30:47 +01:00
Tobias Koppers 2183f05db8 added __resourceQuery, __dir/__filename compile time constant 2013-02-16 22:23:22 +01:00
Tobias Koppers ee01837d66 Refactored everything for 0.9 2013-01-30 18:49:25 +01:00