Commit Graph

240 Commits

Author SHA1 Message Date
Tobias Koppers 18967078cb cleanup modules after compilation to avoid leaking references when they are cached 2021-03-15 11:23:54 +01:00
Tobias Koppers 95f23448a3
Merge pull request #12289 from hodovani/patch-2
Remove duplicate import
2021-01-15 14:16:23 +01:00
Tobias Koppers 7412e71ba5
Merge pull request #11471 from Adityaperiwal/bugfix/ContextModuleRegex
refactor regex
2021-01-04 11:51:54 +01:00
Matvii Hodovaniuk cca8cde2c6
Remove duplicate import 2020-12-30 12:34:42 +02:00
Tobias Koppers ac15f06f2a improve handling of exported Promises 2020-11-16 20:24:54 +01:00
Tobias Koppers 11a7cac537 add useSimpleSourceMap flag to enable/disable OriginalSource for generated code
pass reduced options object to Source.map() function
2020-10-26 16:33:38 +01:00
Aditya bb9168535d refactor regex
add test for context module

refactor linting

refactor test
2020-10-06 21:19:29 +05:30
Tobias Koppers be021e00f4 add grouping of modules 2020-09-01 18:31:22 +02:00
Tobias Koppers d6e637f33c add "snapshot" configuration to allow to configure how snapshots are created
expose snapshot options for module, resolve, buildDependencies and resolveBuildDependencies
move managedPaths and immutablePaths from config.cache to config.snapshot
add timestamp + hash snapshotting mode
use timestamp + hash mode by default in production and for buildDependencies
2020-08-26 01:27:13 +02:00
Tobias Koppers dff76973e4 type fixes 2020-08-24 18:35:28 +02:00
Tobias Koppers cee47dc867 Store cache dependencies inside of Snapshot to reduce cache size 2020-08-24 18:16:54 +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 205bbb4c0d improve compatibly with node.js ESM
improve experiments.mjs to be more compatibly with node.js ESM
  - add support for `type: "module"` in package.json
  - add support for `*.cjs`
  - enable strict ESM for data uris with `text/javascript` or `application/javascript`
  - disallow not fully specified requests in imports `*.mjs` or `type: "module"`

add `descriptionData` rule condition to match package.json info
fix passing resolveOptions along context modules
2020-07-17 13:58:29 +02:00
Tobias Koppers 5068909499 Avoid tracking/printing detailed usage info for modules without exportsType
Make ContextModule a static default exporting module
fix provided exports info for ExternalModule
2020-07-08 11:07:03 +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 525e416395 fix typing issue 2020-06-18 00:21:22 +02:00
Tobias Koppers 2abcfc0058 set dependency categories for all dependencies 2020-06-17 23:04:37 +02:00
Tobias Koppers a4ac8f0328 Cleanup 2020-06-10 14:01:24 +02:00
Tobias Koppers 020cedf383 remove weird types
remove SKIP_OVER_NAME
update tooling for fixed "to not edit" comments
2020-05-12 15:58:43 +02:00
Nathan Shively-Sanders 362514c10b fix 4.0 build errors 2020-05-12 14:37:09 +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
Tobias Koppers 383b3354dd fix typing issue in ContextModule 2020-03-30 10:01:52 +02:00
Mohsen Azimi 7b07a8db66 Upgrade to Prettier 2 2020-03-28 18:20:24 -04:00
evilebottnawi dafa4cd69a chore: setup cspell 2020-03-12 19:51:26 +03:00
Nitin Kumar 285529a643
chore: fix typos across the project 2020-03-10 07:29:46 +05:30
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 522d80f33b allocate less for empty Sets for runtime requirements and file/context/missingDependencies 2020-01-29 21:46:14 +01:00
Tobias Koppers 1070ce925b remove Array.prototype.reduce calls to simplify code 2020-01-17 18:31:29 +01:00
jamesgeorge007 d97b4bd195 fix: typo 2020-01-17 17:59:04 +05:30
jamesgeorge007 39b3f4523c fix: typo 2020-01-17 17:57:37 +05:30
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
Sergey Melyukov 4b499b0429 minor fixes 2019-12-03 17:05:22 +03:00
Sergey Melyukov ba306b6f2c Merge remote-tracking branch 'upstream/master' into optimize-webpack-runtime-size 2019-12-02 19:54:21 +03:00
Sergey Melyukov 6b59d113a4 optimize webpack runtime size 2019-12-02 17:59:37 +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 b90f3e14a1 upgrade webpack-sources
make source maps and source names context independent

add enhanced-resolve declarations
add types to Module.build
fix tooling for import order to support import renaming
add support for concatenated modules in eval source maps
2019-11-12 08:59:08 +01: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 b80174a069 Improve backward-compat for various things
to enable mini-css-extract-plugin
2019-09-26 22:06:54 +02:00
Tobias Koppers d3cf3928f5 Persistent Caching fixes
improve error handling in pack file cache strategy
support context timestamp snapshot
make ContextModule serializable
fix snapshotting bug of managed paths
use managed and immutable path info for context hashes and timestamps
enabled managedPaths for node_modules during cache tests
2019-09-04 16:33:54 +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 b2e7837288 replace Object.assign with object spread 2019-06-19 13:16:05 +02:00
Tobias Koppers e4ba79f0b8 add type coverage for ContextModuleOptions and GroupOptions 2019-06-14 11:44:54 +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 0c39719729 avoid zero sized modules as they lead to problems 2019-05-13 12:29:29 +02:00
Tobias Koppers 61445a5ed0 Merge tag 'v4.29.3' into next
4.29.3
2019-02-07 09:41:34 +01:00
Tobias Koppers 7a5137d7c4 fixes in ContextModule
avoid generating __webpack_require__.e when no chunks are used
add optimized lazy mode when no chunks and no fake make are used
improve module id check
2019-02-06 17:51:16 +01:00
Tobias Koppers d40f7b2642 cache contextify and pass associatedObjectForCache to all calls 2019-01-19 12:40:00 +01:00
Florent Cailhol f05af4a4a7 Use serialization API instead of ObjectMiddleware 2018-12-28 13:54:10 +01:00
Tobias Koppers 1374757006 remove ModuleReason
remove HotUpdateChunkTemplate
move compareLocations into comparators
re-enable NodeSourcePlugin for `.mjs`
2018-12-20 16:38:26 +01:00
Tobias Koppers 5563ee9e58 use makePathsRelative instead of contextify
unify contextify and makePathsRelative
separate NormalModuleFactory ignored, ContextModule and ConcatenatedModule identifier with "|"
2018-12-07 18:12:04 +01:00
Tobias Koppers cc34ea42b0 add type argument to Module.size
add getSize to Generator
2018-12-05 20:18:59 +01:00
Tobias Koppers bf1fc171ba runtime requirement for RuntimeGlobals.moduleFactories 2018-11-29 16:08:52 +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 0232674f9c Initial runtime module work 2018-11-29 16:03:32 +01:00
Florent Cailhol be8c6bbe71 Add types on module files 2018-11-07 14:03:25 +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 83866b0dac use stable sorting for sorting dependencies 2018-10-23 11:32:32 +02:00
Tobias Koppers 4b69df1117 allow to make classes not-serializable
make ContextModule not-serializable because it's not needed
2018-10-18 15:52:22 +02:00
Tobias Koppers f23ce49040 remove module argument from AsyncDepBlock
reorder/remove arguments of ImportDepBlock, AMDRequireDepBlock, RequireEnsureDepBlock
2018-10-17 23:07:01 +02:00
Tobias Koppers 7340fbb547 refactor Cache
add a new hookable Cache class
removed CachePlugin
add MemoryCachePlugin
refactor timestamps
create FileSystemInfo class
2018-09-27 13:20:19 +02:00
Tobias Koppers 4eab41bd5f refactor Module.needBuild to be async 2018-09-27 11:20:54 +02:00
Tobias Koppers 554b417546 Modules are responsible for sorting of dependencies 2018-09-27 11:20:42 +02:00
Tobias Koppers 5b4cbb5ee0 add queues to Compilation
remove Semaphore and use AsyncQueue instead
deprecate Module.needRebuild, add Module.needBuild
remove Module.unbuild
add Module.invalidateBuild
2018-09-12 13:17:03 +02: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 eb63cf80d6 move built flag into Compilation 2018-08-22 15:33:16 +02:00
Tobias Koppers 381e2db200 replace Module.reasons and Dependency.module with ModuleGraph 2018-08-02 17:54:44 +02:00
Tobias Koppers 11e127d162 pass moduleGraph along with multiple methods 2018-08-02 17:54:42 +02:00
Tobias Koppers ec1329a7d4 make libIdent required
add types
2018-08-02 16:29:20 +02:00
Tobias Koppers 4ce109f8c1 change arguments of Generator.generate and Module.source into a object to be easier extensible
add JavascriptModulesPlugin.getHooks().shouldRender to decide if a module should be rendered
2018-08-02 16:07:29 +02:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Tobias Koppers 22c4756c9e add more types to Module 2018-07-25 12:38:34 +02:00
Tobias Koppers bc10939096 add types for Module and subclasses
better way to handle "optional" methods
2018-07-25 12:12:17 +02:00
Tobias Koppers 66d3f319a6 Merge tag 'v4.16.2' into next
4.16.2
2018-07-23 12:19:16 +02:00
Tobias Koppers 2b14ddc984 Merge tag 'v4.16.0' into next
4.16.0
2018-07-11 11:13:47 +02:00
Tobias Koppers 569c415623
Merge branch 'master' into enable-noImplicitThis 2018-07-11 08:43:26 +02:00
Tobias Koppers 79846d138f make loc in context dependencies a correct object 2018-07-10 10:25:13 +02:00
Mohsen Azimi a0e1ad920e Enable noImplicitThis TypeScript compiler option 2018-07-05 08:07:46 +03:00
Tobias Koppers 0a06f19fd8 Merge tag 'v4.15.0' into next
4.15.0
2018-07-04 22:19:50 +02:00
Tobias Koppers fb2c24bf76 add `splitChunks.maxSize` option
add `splitChunks.fallbackCacheGroup`
add `splitChunks.hidePathInfo`
move `contextify` into utils
add some types
2018-07-04 10:45:02 +02:00
Florent Cailhol 91663f19a2 Remove deprecated APIs 2018-06-27 10:08:12 +02:00
Tobias Koppers b4699c0657 add order for DependencyReference
and add types for touched code
2018-06-08 13:20:57 +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
Oded Niv 17fd4d8b48 Align 'Cannot find module' message with native NodeJS 2018-05-15 09:24:16 +03:00
Tobias Koppers a926a19715 create better namespace objects
avoid using Object.assign (fixes #7162)
2018-05-03 12:55:00 +02:00
Tobias Koppers 9cb1a66317 add support for link preload/prefetch
`import(/* webpackPrefetchPriority: 10 */ "...")`
`import(/* webpackPreloadPriority: 10 */ "...")`
2018-04-16 11:29:25 +02:00
Tobias Koppers 8d8da4cdff Merge branch 'master' into bump_prettier 2018-03-29 11:48:02 +02:00
Tobias Koppers f600ccd264
Merge pull request #6827 from Connormiha/optimize-sort-by-identifier
Save identifier module after first getting
2018-03-29 11:00:54 +02:00
Tobias Koppers 93a5bf567f fixes for mini-css-extract-plugin 2018-03-28 16:19:15 +02:00
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Tobias Koppers 9012ab9ace
remove duplicate assignment 2018-03-26 15:46:05 +02:00
Mihail Bodrov ee22d498fe Compute identifier in context module in constructor 2018-03-24 19:02:30 +01:00
Mihail Bodrov 8c11da5219 Save identifier module after first getting 2018-03-23 00:53:26 +03:00
Florent Cailhol 3983803d30 Destructure 'require' to improve readability 2018-03-22 12:05:58 +01:00
Tobias Koppers 6a5d081f29
Merge pull request #6591 from jsoref/spelling
Spelling
2018-02-27 12:50:34 +01:00
Tobias Koppers 8bf15740bb CJS fake namespace object contains exports now
#6576
2018-02-26 19:11:53 +01:00