Tobias Koppers
77f625ab09
upgrade tooling and update types.d.ts
...
fixed SourceMap
import Schema from validate function
2021-05-07 18:01:45 +02:00
Tobias Koppers
b71e0ced35
Merge branch 'master' into johnnyreilly/master
2021-04-22 21:52:48 +02:00
Tobias Koppers
7cc40782b7
fix some internal types
2021-04-22 21:48:25 +02:00
John Reilly
40a5eb17fe
tried generic workarouuund
2021-04-20 09:18:59 +01:00
John Reilly
df44d7d8b7
attempt @sokras suggestion
2021-04-20 06:05:54 +01:00
John Reilly
a2f8808fee
apply @sokra's feedback and include runtime type
2021-04-19 19:30:58 +01:00
John Reilly
586d013b91
feat: LoaderContext type
2021-04-16 19:28:30 +01:00
Tobias Koppers
e21b1d46fe
precompile schemas for improved startup performance
2021-04-16 16:02:58 +02:00
Tobias Koppers
33b44a05ea
DefinePlugin invalidates modules when new defines are added
...
fixes https://github.com/vercel/next.js/issues/23901
2021-04-12 12:23:51 +02:00
Tobias Koppers
87b67a920d
avoid memory leak in v8 ICs after parsing and building modules
2021-03-25 14:52:12 +01:00
shYkiSto
9566a5b732
fix(NormalModule): call super to restore base module cache data
2021-03-23 16:44:03 -07:00
Tobias Koppers
9c648cf90f
improve error handling in beforeLoaders hook
2021-03-22 10:17:17 +01:00
Tobias Koppers
ecb2c18cc6
offer contextify and absoluteify in loader context as utils
2021-03-19 10:59:10 +01:00
Tobias Koppers
5af7e54e7d
Merge pull request #12896 from webpack/feature/define-cache-version
...
DefinePlugin takes care of module invalidation when values have changed
2021-03-15 16:14:35 +01:00
Tobias Koppers
103a51468b
DefinePlugin takes care of module invalidation when values have changed
...
The options of the DefinePlugin no longer have to be covered by build dependencies
2021-03-15 15:19:42 +01:00
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
d9ef8551c0
fix caching of asset modules
2021-02-04 14:13:44 +01:00
Tobias Koppers
52abb681ff
avoid allocation of warning marker weak set when unused
2021-01-27 13:36:03 +01:00
Tobias Koppers
aaadeda40b
non-fs resources should not end up in fileDependencies
...
fixes #12283
2021-01-07 15:37:19 +01:00
Tobias Koppers
09862aacf8
add warning when invalid dependencies are reported by loaders/plugins
...
add automatic workaround for invalid dependencies
#12340
#12283
2021-01-07 13:31:16 +01:00
Tobias Koppers
10aa3daede
add experiments.layers
...
add layers to define different module layers
support module layers in stats
add layer support for NormalModules
fixes #11466
2021-01-05 20:50:59 +01:00
Tobias Koppers
1e2634fdd8
manual side effects flagging should override automatic analysis
2020-12-15 14:40:54 +01:00
Tobias Koppers
c7ea63875c
improve side effects analysis to report imported and reexports symbols as side-effect-free
...
add bailout messages for side effects
2020-11-28 18:10:27 +01:00
Tobias Koppers
cbcd459d19
fix conflicting real imports and type imports
2020-11-26 10:02:59 +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
liximomo
8e9614894c
fix: reorder params
2020-10-16 00:21:16 +08:00
Tobias Koppers
18c20d6327
Merge pull request #11582 from webpack/update-schema-utils
...
chore(deps): update `schema-utils`
2020-10-07 10:30:11 +02:00
Tobias Koppers
fcca1d649d
analyse source code for side effects
...
mark the module as side effects free in such cases
allow 3rd state TRANSITIVE_ONLY to be side-effect-free but dependencies should still be included (for mini-css-extract-plugin)
2020-10-06 14:10:29 +02:00
evilebottnawi
8c19efb7fd
chore(deps): update `schema-utils`
2020-10-05 21:58:54 +03:00
Tobias Koppers
9af1d7526b
refactor module concatenation to address discovered bugs/edge cases
2020-09-15 12:36:02 +02:00
Tobias Koppers
23e91dbbac
move module concatenation bailout checks to Module and for NormalModule to Generator
2020-09-15 12:35:59 +02:00
Tobias Koppers
fdd4a7713f
add ConcatenationScope
2020-09-15 12:34:50 +02:00
Tobias Koppers
eec6fbdd7c
extract loader.target from target option
2020-09-09 19:04:30 +02:00
Tobias Koppers
338f7d404c
cache modules even if they are not parsed
2020-08-26 10:03:00 +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
8ee39ac3ac
fix dependencies when snapshot is missing
2020-08-24 20:37:12 +02:00
Tobias Koppers
cee47dc867
Store cache dependencies inside of Snapshot to reduce cache size
2020-08-24 18:16:54 +02:00
Ivan Kopeykin
4fc44a3398
add more types
2020-08-02 23:47:54 +03:00
Tobias Koppers
ca369f23c5
do cache related tasks after calling handler in watching
...
improve progress output
2020-08-01 09:00:17 +02:00
Tobias Koppers
77cdce7393
remove unused methods, improve code coverage
2020-07-29 11:14:26 +02:00
Tobias Koppers
1265765141
polish, types
2020-07-27 22:41:04 +02:00
Tobias Koppers
e16bdfda6c
refactor used exports analysis, hashing, code generation, optimizations
...
to keep track of runtimes, used exports depending on runtime
modules can have different hashes and generated code depending on runtime
chunks are only considered as equal for MergeDuplicateChunks and SplitChunks when exports used in contained modules are equal
added `optimization.usedExports: "global"` to opt-out from used exports analysis per runtime
added `splitChunks.usedExports` and `splitChunks.cacheGroups[x].usedExports` to enable/disable used exports comparing for modules
`splitChunks.usedExports` defaults to `true` in production
2020-07-27 22:40:44 +02:00
Tobias Koppers
7dad1c1c30
refactor scheme handling into plugins
2020-07-03 17:01:02 +02:00
Ivan Kopeykin
d42d2b51df
check for Windows absolute url in URLAbsoluteSpecifier util
2020-06-29 12:24:44 +03:00
Ivan Kopeykin
89abab2631
add absolute url specifier support
2020-06-26 22:16:27 +03:00
goganchic
19609937c7
implement uri imports
2020-06-05 15:15:10 +03:00
Mohsen Azimi
042b4ee7d4
Use @ts-expext-error
2020-05-12 14:34:29 +02:00
Tobias Koppers
3b49828a18
report better error message when wasm experiment is not enabled
...
#10788
2020-04-28 20:22:50 +02: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
87ad88174b
Merge pull request #10354 from jeffin143/minor-code-refactor
...
Minor code refactoring to use destructuring
2020-02-10 13:15:17 +01:00
jeffin143
a50f0d50e6
refactor: make use of destructuring
2020-02-08 03:08:53 +05:30
Tobias Koppers
ec5a744b30
Remove "error" and "ignore" from snapshots
2020-01-29 21:32:50 +01:00
jamesgeorge007
974d2495af
fix: typo
2020-01-19 13:31:37 +05:30
jamesgeorge007
5506161f5e
refactor: use startsWith
2020-01-19 13:29:39 +05:30
jamesgeorge007
357e707e2c
refactor: prefer destructuring approach
2020-01-19 13:28:22 +05:30
Tobias Koppers
d673e4179b
test errors message, allow custom names in schema
2020-01-17 12:17:53 +01:00
Tobias Koppers
f9846f1f91
improve code, remove unneeded old stuff
2020-01-16 14:48:52 +01:00
evilebottnawi
4e808cb613
feat: getOptions util for loader
2020-01-16 11:43:26 +01:00
Tobias Koppers
c80bae2959
faster cache access of contextify
2020-01-15 11:20:22 +01:00
Tobias Koppers
73978b1463
handle sourceRoot during source map contextify
2019-12-27 15:23:23 +01:00
Tobias Koppers
2f3da77d38
Introduce a Parser base class to improve Parser types
...
Parser.parse must be always sync
make JSON and WASM modules strict
fix inherit-types tooling to omit static methods
2019-11-30 01:36:28 +01:00
Tobias Koppers
bf6680ec0f
bugfixes, nitpicks
2019-11-26 21:24:41 +01:00
Tobias Koppers
317da38171
move data url condition to parser
...
avoid calling dataUrl function repeated
remove cache to avoid memory leak
include data url decision in module hash
refactor code for readablility
2019-11-26 15:43:58 +01:00
Sergey Melyukov
bdc61abf82
refactor: merge generators in asset modules
2019-11-26 15:42:37 +01:00
Tobias Koppers
1cd9ec58aa
track dependencies when calling resolve from loader
2019-11-25 22:10:47 +01:00
Tobias Koppers
a58717e379
types for NormalModule constructor
2019-11-20 12:43:57 +01:00
Tobias Koppers
55914b2e46
Generator.generate may return null
2019-11-20 12:43:56 +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
5abf55b1af
allocate presentationalDependencies array only when needed
2019-11-10 21:05:28 +01:00
Tobias Koppers
c5483fa7ab
allocate NormalModule._sourceSizes only when needed
2019-11-10 21:05:19 +01:00
Tobias Koppers
ed81ad0fa4
allocate warnings and errors arrays only when needed
2019-11-10 21:05:16 +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
ac9fca474a
avoid creating an object for performance reasons
2019-10-09 13:36:44 +02: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
e116d18544
Merge tag 'v4.40.3' into next
...
4.40.3
2019-09-25 23:51:38 +02:00
Daniel Playfair Cal
2aef0b615b
Memoize NormalModule.size()
2019-09-20 10:44:49 +10:00
Tobias Koppers
7bde43f47a
Merge tag 'v4.40.0' into next
...
4.40.0
2019-09-13 11:12:26 +02:00
Tobias Koppers
758269e814
add emit/updateAsset to Compilation
...
add asset info with
* immutable for long term cache-able asset
* size for the asset size in bytes
* development for devtools
* hotModuleReplacement for HMR assets
show asset info in stats
2019-09-11 14:43:42 +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
e877e0ec91
Modules don't carry buildDependencies, they add them directly to compilation
...
buildDependencies should not be stored/cached as they are only effective when really build
2019-08-13 18:05:26 +02:00
Tobias Koppers
856235d76f
track and config build dependencies
2019-08-12 23:07:41 +02:00
Tobias Koppers
c17dfde7a8
Merge tag 'v4.37.0' into next
...
4.37.0
2019-07-24 10:51:04 +02:00
Tobias Koppers
677ccd90ea
small fixes
2019-07-23 09:28:06 +02:00
Tobias Koppers
d849160d3f
add logging API
...
Plugins:
Compiler.getInfrastructureLogger(name)
Compilation.getLogger(name)
Loader:
this.getLogger([name])
API equal to console API with these methods:
error, warn, info, log, debug,
time, timeLog, timeEnd,
group, groupCollapsed, groupEnd,
profile, profileEnd,
clear
2019-07-18 17:13:40 +02:00
Tobias Koppers
cac462cba8
Merge pull request #8983 from hiroppy/feature/url
...
add experimental Url support
2019-07-17 23:32:15 +02:00
Tobias Koppers
1d72a05fed
Merge tag 'v4.36.0' into next
...
4.36.0
2019-07-17 16:02:33 +02:00
Tobias Koppers
fb45e38fa4
rename url -> asset
...
remove experimental in favor of experiments.asset
2019-07-17 11:57:04 +02:00
Yuta Hiroto
8788add912
fix(TemplatedPathPlugin): keep compatibility with `.[ext]`
...
[ext] has `.` but file-loader is specified `[hash].[ext]` as default.
2019-07-17 11:46:37 +02:00
ikopeykin
27b1e17f5b
createHash typescript
2019-07-10 14:06:36 +03:00
Tobias Koppers
b2e7837288
replace Object.assign with object spread
2019-06-19 13:16:05 +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
6f25c3bdbd
Merge pull request #9150 from cacheflow/show-loaders-used-when-module-parsing-fails
...
feat(NormalModule/ModuleParseError): Show loaders used from config when module parsing fails
2019-06-04 23:24:21 +02:00
Tobias Koppers
45582c51e7
avoid loading from rule set, simplify
2019-06-03 17:00:50 +02:00
Lex Alexander
1c6e7a9344
feat(NormalModule/ModuleParseError): Show loaders used from config when module parsing fails
...
-Closes #9025
2019-05-29 14:11:49 -07:00
Tobias Koppers
db5a8a33d3
fix error handling on parse errors
2019-05-24 15:53:34 +02:00
Tobias Koppers
abc825d58f
Merge tag 'v4.32.0' into next
...
4.32.0
2019-05-20 14:46:31 +02:00
Tim Schaub
1a63d7bd0d
Default to production
...
Co-Authored-By: Tobias Koppers <tobias.koppers@googlemail.com>
2019-05-16 13:50:31 -06:00
Tim Schaub
290ab5d071
Allow loaders to access the mode
2019-05-16 10:18:16 -06:00
Tobias Koppers
0c39719729
avoid zero sized modules as they lead to problems
2019-05-13 12:29:29 +02:00
Florent Cailhol
b12f24d20c
Update hook types
2019-05-10 09:52:22 +02:00
Tobias Koppers
0e62bdb74a
add missing cache
2019-01-19 13:12:43 +01:00
Tobias Koppers
c5ad6df793
add own webpack-sources typings
2019-01-18 21:56:56 +01:00
Tobias Koppers
e4d1a45c8d
Use FileSystemInfo.createSnapshot for NormalModules too
2019-01-09 14:42:57 +01:00
Tobias Koppers
ca430a6715
hash defaults to undefined
...
provide other properties in buildInfo
2018-12-31 12:50:45 +01:00
Tobias Koppers
a3c166109e
move NormalModule._buildHash into buildInfo
2018-12-31 12:28:57 +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
cc34ea42b0
add type argument to Module.size
...
add getSize to Generator
2018-12-05 20:18:59 +01:00
Tobias Koppers
dff9278d6b
add Module.getSourceTypes
...
getSourceTypes declares all source types which can be generated
Remove shouldRender in favor of source type testing
2018-12-05 20:18:57 +01:00
Tobias Koppers
0ff1a4f8f8
Merge tag 'v4.27.0' into next
...
4.27.0
2018-12-04 11:02:26 +01:00
Tobias Koppers
162da1c509
add getResolve method to loader context
...
with allows to pass options
2018-12-03 12:42:28 +01:00
Tobias Koppers
7c37a6a972
handle runtime requirements
2018-11-29 16:07:17 +01:00
Tobias Koppers
2525c8b7aa
move runtime requirements storage into ChunkGraph
...
use info for function generation
for noParse default to module and exports requirements
2018-11-29 16:06:44 +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
101b0ebb0f
Add typings for JSON parser & deps
2018-11-23 21:52:05 +01:00
Tobias Koppers
23b335d902
Merge branch 'next' into types/modules
2018-11-16 14:40:11 +01:00
Florent Cailhol
3766869c48
Move normalModuleLoader hook
2018-11-12 14:26:32 +01:00
Florent Cailhol
23bd3d7bd4
Add type guard for NormalModule
2018-11-12 14:26:32 +01:00
Florent Cailhol
caefde17ab
Remove devtoolLineToLine and lineToLine options
2018-11-12 14:26:31 +01:00
Florent Cailhol
8a10ea3c92
Type 'apply' method of plugins
2018-11-12 14:26:31 +01:00
Florent Cailhol
be8c6bbe71
Add types on module files
2018-11-07 14:03:25 +01:00
Tobias Koppers
4174521f9d
remove unnecessary module arguments from module attached errors
2018-10-29 22:18:08 +01:00
Tobias Koppers
6a8e201521
fixup WebpackErrors
2018-10-25 10:52:28 +02:00
Tobias Koppers
83866b0dac
use stable sorting for sorting dependencies
2018-10-23 11:32:32 +02:00
Tobias Koppers
a852828279
add persistent caching prototype
2018-10-17 21:25:39 +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
239ce7fcd9
Use ChunkGraph instead of Compilation in updateHash
2018-08-24 12:02:42 +02:00
Tobias Koppers
670502fc81
Move AsyncDependenciesBlock.chunkGroup into ChunkGraph
2018-08-22 20:17:49 +02:00
Tobias Koppers
3aa2280498
move Module.hash and .renderedHash into ChunkGraph
2018-08-22 19:24:54 +02:00
Tobias Koppers
eb63cf80d6
move built flag into Compilation
2018-08-22 15:33:16 +02:00
Tobias Koppers
a6e1c0693c
add TODOs
2018-08-16 14:10:39 +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
f68c1f7ab6
add additional arguments to updateHash
2018-08-02 16:04:10 +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
0052861178
remove unconsistency with Module._source and originalSource
2018-07-25 12:20:35 +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
8614c75f11
run inherit types tool on existing code
2018-07-21 13:50:18 +02:00
Tobias Koppers
ff7d0f56e7
Merge pull request #7704 from webpack/refactor/dependency-templates
...
make DependencyTemplates a new class
2018-07-12 19:11:58 +02:00
Tobias Koppers
568601c7fa
remove `exec` from loader context
...
`require-from-string` can be used instead
2018-07-11 17:48:47 +02:00
Tobias Koppers
e0abce0dd8
make DependencyTemplates a new class
2018-07-11 13:11:08 +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
Tobias Koppers
deb798d8a7
add TODO comment
2018-06-25 16:42:19 +02:00