Commit Graph

65 Commits

Author SHA1 Message Date
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
Sergey Melyukov f212d3c30e pr comments 2019-12-03 18:11:46 +03:00
Sergey Melyukov 4b499b0429 minor fixes 2019-12-03 17:05:22 +03:00
Sergey Melyukov faf784b6ab refactor hop runtime helper 2019-12-03 16:27:39 +03:00
Tobias Koppers 5a01ed8121 rename exportsType named to default
exportsType default doesn't include named exports in strict esm
2019-11-20 12:43:53 +01:00
Tobias Koppers 9a07012695 fix problem with accessing the default named export of json 2019-11-05 10:39:14 +01:00
Tobias Koppers 84b6817f60 consistency and bugfixes for reexporting json 2019-11-05 10:39:12 +01:00
Tobias Koppers 14ee25cd0a add support for tree-shaking JSON modules 2019-11-05 10:37:59 +01:00
evilebottnawi 8764f14794 feat: improve DX with `output.ecmaVersion` option 2019-10-11 00:43:27 +03:00
Tobias Koppers ddc3dae0e6 refactor Module.source() and Module.getRuntimeRequirements() into Module.codeGeneration
add code generation phase to Compilation
add `output.iife` options to remove iife wrapper
add `experiments.outputModule` which enabled `output.module`
add `output.module` which sets defaults to `output.iife: false`, `output.libraryTarget: "module"`, `output.jsonpScriptType: "module"`, `terserOptions.module: true`
add `output.module` example
improve runtime requirements needed by ConcatenatedModule
add entry inlining, which inlines entry module code into runtime scope (only when safe)
make whole bundle strict when all modules are strict
2019-10-08 23:59:48 +02:00
Tobias Koppers e507392094 add output.ecmaVersion options to set emitted code style
fix a bug with prefetching initial chunks
InitFragments have get[End]Content methods which get a sourceContext
RuntimeModules have implicit chunk and compilation
changed default to `output.ecmaVersion: 2015`
2019-08-26 21:32:29 +02:00
Tobias Koppers 9915088cbc improvements 2019-07-17 11:57:08 +02:00
Tobias Koppers 6db94536ad Merge tag 'v4.34.0' into next
4.34.0
2019-06-13 10:51:12 +02:00
Tobias Koppers 43bc7a306e Refactor to track nested exports
Harmony dependencies track access to nested properties
Flag nested exports
2019-05-29 11:55:00 +02:00
Tobias Koppers 180f912493 Merge tag 'v4.29.2' into next
4.29.2
2019-02-06 15:37:11 +01:00
Tobias Koppers 9048500acf remove unneeded moduleGraph argument 2018-12-31 12:32:12 +01:00
Florent Cailhol a42922f663 Move provided exports to the module graph 2018-12-31 12:28:51 +01:00
Tobias Koppers 9d91861592 Refactor HMR for runtime modules
fixed a few HMR bugs
allow other module types for HMR
made HMR more flexible
2018-11-29 16:22:29 +01:00
Tobias Koppers f753f92c28 ensureChunk to RuntimeModule
step 1: non HMR cases
2018-11-29 16:16:39 +01:00
Tobias Koppers 2849281702 remove generateContext from RuntimeModule.generate
add public path runtime module
2018-11-29 16:13:26 +01:00
Tobias Koppers bf1fc171ba runtime requirement for RuntimeGlobals.moduleFactories 2018-11-29 16:08:52 +01:00
Tobias Koppers 32c3fca477 extract definePropertyGetter into RuntimeModule 2018-11-29 16:08:17 +01:00
Tobias Koppers 7c37a6a972 handle runtime requirements 2018-11-29 16:07:17 +01:00
Tobias Koppers c1e89c0543 Runtime requirement support in NormalModule, Generators and DependencyTemplate 2018-11-29 16:06:12 +01:00
Tobias Koppers eb28697419 move magic property names on __webpack_require__ into RuntimeGlobals file 2018-11-05 15:28:34 +01:00
Tobias Koppers bad9d8a271 move Module.id into ChunkGraph
remove disconnect and unseal from Module
2018-08-28 15:08:52 +02:00
Tobias Koppers 02b15a1b46 pass chunkGraph to updateHash instead of moduleGraph
pass chunkGraph to compareModulesById instead of moduleGraph
pass chunkGraph to methods of RuntimeTemplate
use comparators from module at some places
2018-08-28 12:06:53 +02:00
Tobias Koppers 670502fc81 Move AsyncDependenciesBlock.chunkGroup into ChunkGraph 2018-08-22 20:17:49 +02:00
Tobias Koppers d6cf42e4c2 merge used with usedExports
usedExports = false now means module is not used
2018-08-06 21:05:11 +02:00
Tobias Koppers c4e0a9f72e Move Module.used and Module.usedExports into ModuleGraph 2018-08-06 21:04:01 +02:00
Florent Cailhol 367b02a0f0 Use RuntimeTemplate to generate error code 2018-07-31 09:01:06 +02:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Tobias Koppers 138687730a only assign module ids for modules in chunks
handle weak dependencies without id correctly
2018-07-27 13:16:54 +02:00
Tobias Koppers fcf3f63f0e add DependencyTemplate base class and inherit types from this
fix a few typing issues
2018-07-23 20:11:59 +02:00
Tobias Koppers 8614c75f11 run inherit types tool on existing code 2018-07-21 13:50:18 +02:00
Tobias Koppers 50fe2e79ee add Compilation.getDependencyReference and hooks to override it
expose DependencyReference class
2018-06-23 15:13:14 +02:00
Florent Cailhol 2a9452e51b Add brackets for multiline if/for statements 2018-05-29 15:45:44 +02:00
Tobias Koppers 770847171d Merge branch 'master' into bugfix/namespace-object
# Conflicts:
#	lib/RuntimeTemplate.js
2018-05-28 22:42:21 +02:00
Tobias Koppers 7ebe12dde1 throw error when unexpected state has been found 2018-05-27 21:53:21 +02:00
Oded Niv 17fd4d8b48 Align 'Cannot find module' message with native NodeJS 2018-05-15 09:24:16 +03:00
Tobias Koppers d4a04b8934 Merge branch 'master' into bugfix/namespace-object
# Conflicts:
#	test/__snapshots__/StatsTestCases.test.js.snap
2018-05-09 10:27:23 +02:00
Tobias Koppers f2ad440de8 More strict linting of jsdocs
Use TODO over any when type is possible
2018-05-08 14:53:33 +02:00
Tobias Koppers a926a19715 create better namespace objects
avoid using Object.assign (fixes #7162)
2018-05-03 12:55:00 +02:00