Commit Graph

25 Commits

Author SHA1 Message Date
Adam Postma ff8c37e887 correct spelling mistake, update identifer to identifier 2019-04-12 10:29:41 -06:00
Tobias Koppers 0f7355e170 Merge tag 'v4.28.4' into next
4.28.4
2019-01-10 16:51:17 +01:00
Steven Hargrove 2a04deed22 added ExportAllDeclaration, fixed fn signature 2019-01-04 08:53:08 -05:00
Steven Hargrove 41b6887143 use faster statement type check 2019-01-03 14:39:52 -05:00
Tobias Koppers 6d09410a26 remove parserScope
it's not serializable and not needed anyway
2018-09-27 13:40:58 +02:00
Tobias Koppers 3618cc1b3c remove originModule from Dependencies and add parent module to ModuleGraph 2018-08-07 14:20:53 +02: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 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
Florent Cailhol d4811b0d37 Use for-of loops instead of forEach 2018-01-23 22:53:18 +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
Tobias Koppers 53a1d6c7b5 replace harmonyModule flag with exportsType 3-state
exportsType falsy: It's non-harmony module
exportsType "namespace": It's a harmony module, the exports is the namespace object
exportsType "default": It's a harmony module, the exports is the default exports, named exports are properties of the default export
2017-12-22 19:42:41 +01:00
Florent Cailhol 9669c9e013 Use Parser#hooks instead of Tapable#plugin 2017-12-21 09:08:10 +01:00
Tobias Koppers ffb977fed4 refactor meta -> buildMeta, add factoryMeta
add compat layer to Module.meta
2017-12-12 16:57:50 +01:00
Tobias Koppers 21cdc84b71 process imports from mjs to non-esm correctly
give nice error messages when importing non-esm the wrong way
It also disallows using namespace object from non-esm modules

fixes #5686
2017-11-23 14:10:52 +01:00
Tobias Koppers a53672d1a2 Merge branch 'master' into next
# Conflicts:
#	lib/EvalSourceMapDevToolModuleTemplatePlugin.js
#	lib/dependencies/HarmonyDetectionParserPlugin.js
#	lib/dependencies/HarmonyImportDependency.js
#	package.json
#	schemas/webpackOptionsSchema.json
#	test/Validation.test.js
2017-11-17 16:03:46 +01:00
Tushar Sharma a163cad8f2 eslint fixes 2017-11-15 14:08:44 +05:30
Tushar Sharma ee84d788dd vars to lets and const 2017-11-15 13:58:45 +05:30
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
Tobias Koppers 5c489b6c5d Refactor harmony modules
separate side effects from specifier
fixes TDZ for export let/const
bigger bundles are caused by correct export const/let behavior

BREAKING CHANGE: Internal have changed. Plugins could rely on them.
2017-09-14 09:44:32 +02:00
Tim Sebastian 9ca60841b4 use const where applicable in HarmonyDetectionParserPlugin 2017-02-05 10:15:47 +11:00
Fernando Montoya e6d7c064f2
Fixes #4060. Rename class HarmonyCompatiblilityDependency to HarmonyCompatibilityDependency 2017-01-19 13:43:42 -05:00
Tobias Koppers a7a41848c7 remove error for CommonJs/AMD in ESM
there are too many weird modules

detect harmony modules before parsing
exports is now undefined in ESM
module.exports is now read-only in ESM and returns undefined
define is now undefined in ESM
#3917
2017-01-15 01:44:26 +01:00