Commit Graph

256 Commits

Author SHA1 Message Date
Tobias Koppers 39d2f8f7f3 fix URL nitpicks 2020-09-02 15:09:41 +02:00
Ivan Kopeykin 4157166263 Merge branch 'master' into feature/asset-url
# Conflicts:
#	test/Defaults.unittest.js
2020-08-16 15:47:05 +03:00
Ivan Kopeykin 65bed95efe pass dependencyType directly to ruleset 2020-08-06 21:34:47 +03:00
Ivan Kopeykin fcac182805 match dependency with Rule 2020-08-06 02:08:06 +03:00
Ivan Kopeykin ddc83b0d70 feat: url assets 2020-08-05 00:55:38 +03:00
Ivan Kopeykin 4fc44a3398 add more types 2020-08-02 23:47:54 +03: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 5f4c4662dd rename parsePathQueryFragment to parseResource and add caching 2020-07-06 17:39:52 +02:00
Tobias Koppers f6aadd01f1 remove unneeded scheme property in createData 2020-07-03 17:19:43 +02:00
Tobias Koppers 7442a211b9 add support for resource fragments 2020-07-03 17:03:15 +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
Tobias Koppers b30b9681fa opt-out from unsafe caching when providing shared module as side-effect 2020-06-24 23:06:36 +02:00
Tobias Koppers ba9027ac1a
Merge pull request #10719 from goganchic/feature/data-uri
Implement Data URI imports
2020-06-24 11:08:44 +02:00
Ivan Kopeykin 8174145782 upgrade enhanced-resolve 2020-06-17 14:22:37 +03:00
Ivan Kopeykin 198e51a485 Merge branch 'master' into exports-field
# Conflicts:
#	lib/dependencies/ImportDependency.js
#	lib/sharing/ConsumeSharedPlugin.js
#	lib/sharing/ProvideSharedPlugin.js
#	types.d.ts
2020-06-16 21:16:41 +03:00
Ivan Kopeykin 3f8def8185 fix discussions
- add module condition
- rename EnhancedResolveOptions
- fix applyByDependency util function
- use EMPTY_RESOLVE_OPTIONS when resolveOptions are undefined
2020-06-16 21:02:31 +03:00
Tobias Koppers 1c42f71250 allow to provide and consume multiple versions of shared modules 2020-06-13 14:45:37 +02:00
Ivan Kopeykin d2a08e3cc8 rework how byDependency applied
remove dependencyType parameter for resolver factory
add dependencyType option in enhanced resolve options
2020-06-09 01:32:24 +03:00
goganchic 819dd10a22 rename dataURIMimetype and remove redundant regex check 2020-06-05 16:08:06 +03:00
goganchic 4b59a302a2 add mimetype rule 2020-06-05 15:15:11 +03:00
goganchic 1cdd38d3c0 check for data-uri before resource resolving 2020-06-05 15:15:11 +03:00
goganchic 19609937c7 implement uri imports 2020-06-05 15:15:10 +03:00
Ivan Kopeykin d4b1819749 add ability to set resolve options per dependency category
- byDependency option
- create resolver per dependency category
2020-05-28 02:30:29 +03:00
Ivan Kopeykin b7098ae52b define dependency category as string instead of enum 2020-05-27 22:57:45 +03:00
Ivan Kopeykin 8c1d64c5fd rework how condition names pass to resolve option 2020-05-27 02:27:52 +03:00
Ivan Kopeykin 7f84f6be46 support import and require condition names 2020-05-26 00:48:41 +03:00
Emanuele Stoppa e607681277 fix: replaced some TODO with correct types and fixed some runtime issue 2019-11-28 22:48:01 +01:00
Sergey Melyukov 491cb57cb4 initial improvement for asset modules 2019-11-26 15:41:48 +01:00
Tobias Koppers 1f3d2b680e rename empty object constant 2019-11-19 13:14:58 +01:00
Tobias Koppers e00b0a40d4 avoid has -> get, set -> get 2019-11-19 12:17:46 +01:00
Sergey Melyukov 53764f5d36 refactor: fix review comments 2019-11-18 20:01:54 +03:00
Sergey Melyukov 265ef68405 refactor: improve generator/parse cache in module factory 2019-11-18 18:12:12 +03:00
Tobias Koppers c21fb4bd58 Add LazySet for file/context/missingDependencies for performance 2019-08-07 16:13:56 +02:00
Tobias Koppers c94073b31c update enhanced-resolve 2019-07-05 00:45:41 +02:00
Tobias Koppers 8bf8e857ad Merge tag 'v4.35.1' into next
4.35.1
2019-07-01 11:15:52 +02:00
Tobias Koppers fec4d536a3 only affect loader order when match resource is used 2019-07-01 09:37:35 +02:00
James Chapman 49dc747a63 fix loader ordering 2019-06-25 19:26:53 +01:00
Tobias Koppers 6db94536ad Merge tag 'v4.34.0' into next
4.34.0
2019-06-13 10:51:12 +02:00
Tobias Koppers e9c0d068dd refactor filesystem interfaces
add Compiler.intermediateFileSystem
avoid using `path` and `fs` module when possible
move `join`, `mkdirp` and `dirname` into utils
join and dirname is optional in FileSystem interface
remove mkdirp from Filesystem interface
2019-06-11 17:32:58 +02:00
Tobias Koppers fd4b3c503a pretty files 2019-06-09 11:23:42 +02:00
Tobias Koppers 51b19ebd1f make refs independent of number of default rules 2019-06-04 11:33:16 +02:00
Tobias Koppers 74d4669d73 rewrite RuleSet to RuleSetCompiler with plugins
remove some deprecated features (query, loaders)
add missing condition (realResource)
2019-05-16 11:37:52 +02:00
Tobias Koppers f03c4f127a improve merging of resolve and parsing options
by rules and via loader API

Objects are deeply merged
Arrays overwrite by default, but can reference old value with "..."

fixes #8968
2019-05-13 15:30:10 +02:00
Tobias Koppers aa05168971 fixups 2019-05-10 11:06:25 +02:00
Tobias Koppers 90baf475af Smaller performance improvements in NormalModuleFactory 2019-01-08 15:14:33 +01:00
Tobias Koppers ef9e25d8ea report dependencies from resolver to the compilation
refactor NormalModuleFactory
2019-01-08 15:14:25 +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 a21bc44345 ignored module no longer contain context path 2018-12-07 15:46:32 +01:00
Tobias Koppers 3b35fd478c use module.unsafeCache only for node_modules
remove unsafe resolve cache remainings
2018-10-31 13:17:32 +01:00
Tobias Koppers 2e82dbb63c
Merge pull request #7813 from webpack/refactor/freeze_hooks
Freeze hooks to prevent deopts
2018-07-30 22:47:13 +02:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Florent Cailhol fc4f30329d Freeze hooks to prevent deopts 2018-07-30 14:25:40 +02:00
Florent Cailhol c68d0d2171 Remove Tapable compatibility 2018-06-26 08:31:08 +02:00
Tobias Koppers 530e1fb172 Add matchResource feature (for loaders)
Match rules with custom resource name
Also use this name as rule.issuer or splitChunks test
Show nicely in stats
2018-06-01 15:37:17 +02:00
Florent Cailhol 2a9452e51b Add brackets for multiline if/for statements 2018-05-29 15:45:44 +02:00
moondef 25c7b07ef3 Fix link 2018-05-24 17:05:56 +03:00
Florent Cailhol 8df9f5f1f5 Use a WeakMap instead of mutating objects 2018-05-22 19:06:30 +02:00
Florent Cailhol 5c8a4bb89f Unify Dependency#getExports result 2018-04-04 13:53:55 +02:00
Florent Cailhol b6042fb937 Prevent identToLoaderRequest to return 2 objects with different shapes 2018-04-04 13:41:56 +02:00
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Florent Cailhol 3983803d30 Destructure 'require' to improve readability 2018-03-22 12:05:58 +01:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Suguru Motegi 864e563173 replace Async with Neo-Async 2018-02-11 14:31:08 -08:00
Tobias Koppers 5c63d3cb43 move source generation into separate module
allow to pass a Generator to NormalModule
change NormalModule constructor to options object

🍆
2018-01-24 11:33:38 +01:00
Florent Cailhol d4811b0d37 Use for-of loops instead of forEach 2018-01-23 22:53:18 +01:00
Florent Cailhol 86e6edf1ab Refactor how source type is handled by the parser 2018-01-22 09:30:43 +01:00
Mihail Bodrov a403cbf3a9 Optimize regexp, getEntryPointsSize 2018-01-20 00:43:27 +03:00
Tobias Koppers cf1d7b8949 `-!` keeps post loader instead of pre loader
add more test cases
2017-12-30 19:34:14 +01:00
Florent Cailhol 202e399fff Do not use deprecated features of enhanced-resolve
- First argument of `Resolver#doResolve` is now a Hook
- Fourth argument of `Resolver#resolve` is now `resolveContext`. `callback` is the fifth.
2017-12-22 19:54:57 +01:00
Tobias Koppers 1172d842f7 Merge branch 'master' into next 2017-12-22 12:28:15 +01:00
Tim Kendrick b48d5d99f6 Maintain ident when chaining pitching loaders 2017-12-21 18:20:24 +00:00
Tobias Koppers 27d60f7dd6
Merge pull request #6126 from ooflorent/remove_plugin_calls
Remove more plugin calls
2017-12-15 13:42:38 +01:00
Florent Cailhol f737b26260 Remove some plugin calls 2017-12-14 14:42:49 +01:00
Tobias Koppers 5cbd6b20dd allow to set sideEffects from rules 2017-12-14 13:08:57 +01:00
Tobias Koppers a27ef326d5 Upgrade tapable in ModuleFactories 2017-11-28 09:54:24 +01:00
Tobias Koppers 5a4f0aca67 change imports of tapable to old version
prepare to migrate to new tapable version
2017-11-27 20:56:42 +01:00
Tobias Koppers 5e39ec46ee Allow to override resolve configuration 2017-11-18 08:12:35 +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 0ae5fede3d move parser creation into separate plugins 2017-11-10 11:36:46 +01:00
Tobias Koppers 41a1d602e1 added WebAssembly Proof of Concept 2017-11-10 09:17:11 +01:00
Tobias Koppers f7c2f8e470 Update code style to arrow functions 2017-11-08 11:56:01 +01:00
Tobias Koppers 794b883f0a Merge branch 'next' into deprecation/webpack-3 2017-09-22 14:30:04 +02:00
Tobias Koppers 7ceac63f07 add support for pure modules 2017-09-14 09:44:42 +02:00
Tobias Koppers 4105297de6 Merge branch 'next' into deprecation/webpack-3 2017-09-11 11:26:44 +02:00
Tobias Koppers 874fac5337 tapable update and performance 2017-08-08 09:44:10 +02:00
Tobias Koppers 45301b7dc6 rewrite code to no longer require `beautify preserve` 2017-07-24 11:54:58 +02:00
Tobias Koppers 9cf6d51df6 disallow module.loaders 2017-06-14 14:42:31 +02:00
SendilKumar N cd688f84da changing async to asyncLib 2017-04-05 21:06:23 +08:00
Sergey Melyukov 3ebcf71e8e let to const in NormalModuleFactory 2017-04-04 11:27:36 +03:00
Sergey Melyukov 7c4883c103 ES6 refactoring in NormalModuleFactory 2017-04-04 00:28:08 +03:00
Tobias Koppers 584f4da4a3 Merge pull request #4500 from timse/make-ignored-relative
Make ignored relative
2017-04-03 17:00:15 +02:00
Jan-André Zinser 983904cfa3 Provide context to resolve again
Brings the old behaviour back that was removed in da29d21ae4
2017-04-02 20:48:39 +02:00
Tim Sebastian ce5e3e1e8d remove unused path from normalmodulefactory 2017-03-23 21:48:13 +11:00
Tim Sebastian 62229f5302 make path ignored before it goes to records, prevent to have to do it in NMF 2017-03-23 00:05:15 +11:00
Tim Sebastian 8165522e81 add formatting 2017-03-18 00:35:05 +11:00
James Tautges a368ed1f8c Use relative instead of resolve 2017-03-17 21:33:31 +11:00
James Tautges a4cf604a4a Relativize ignore module paths 2017-03-17 21:33:31 +11:00
Tobias Koppers 479a0a4b7b Merge pull request #4189 from webpack/feature/child-plugins
child compiler features
2017-02-22 15:01:08 +01:00
Tobias Koppers fbf84d51f2 allow to apply plugins to child compiler
allow to match on compiler name in rules

#4177
2017-02-22 11:49:49 +01:00
Tobias Koppers ed8acd4bb9 change way how resourceResolveData is passed 2017-02-21 09:34:07 +01:00
Jason Quense df71a073b5 rename property; lint issue 2017-02-20 11:48:48 -05:00
Jason Quense 3215e2ccde fix tests 2017-02-20 11:09:20 -05:00
Jason Quense 9afd2897a5 Add resolver result to module callback 2017-02-20 10:22:17 -05:00
Simon Legner e3be39c49a NormalModuleFactory: link to doc in error message
Add link to migrating guide when omitting the '-loader' suffix.
2017-02-07 09:03:57 +01:00
Tobias Koppers 4cae3f4987 generate loader ident automatically
pass ident outside of option object

commit based on work from @timse #4073
2017-01-26 01:27:00 +01:00
Tobias Koppers 8e69a80847 code linting 2017-01-11 12:29:01 +01:00
Joe Bateson a8bb6cdb1c refactor(es6): Replace object-assign polyfill with native method (#3608) 2016-12-28 13:07:28 -06:00
Tobias Koppers f4ab7fc7e2 more performance improvements 2016-12-14 16:22:54 +01:00
Tobias Koppers da29d21ae4 performance improvements
breaking change: Module has now a "unbuild" method that must work correctly
2016-12-14 16:22:16 +01:00
Tobias Koppers adb1a1b4d8 reformat to make beautify happy 2016-12-14 13:57:51 +01:00
Tobias Koppers 980c2a9c85 add test cases and fixes overwrite 2016-12-14 13:27:33 +01:00
Sean Larkin 643e52edf9 chore(nmf): cleanup duplicate query parse logic 2016-12-08 09:57:47 -06:00
Sean Larkin 1999af3ef6 feature(alias): allow loader query to be used for aliased loader 2016-12-08 02:58:56 -06:00
Tobias Koppers f4adee3e9d Merge pull request #3360 from webpack/bugfix/loader-options-remaining-request
fixes a bug in which complex options are not passed through chain
2016-11-23 22:28:45 +01:00
Tobias Koppers efa3fc058b added resourceQuery condition
added function use to schema
2016-11-23 12:12:32 +01:00
Tobias Koppers 5f9dd3c219 fixes a bug in which complex options are not passed through chain 2016-11-23 12:11:07 +01:00
John Schulz 0f69d67a5a Update `-loader`error message
`-loader` is a suffix, not a prefix. A prefix goes at the beginning of a word, and a suffix goes at the end.
2016-11-15 16:05:43 -08:00
Tobias Koppers 5803fd7fe3 display a note about the breaking change when forgot the -loader prefix 2016-11-14 21:25:26 +01:00
Markus Kramer 9c5c6df64f replaced calls to Object.assign with objectAssign to support node 0.12.x (#3080) 2016-09-30 09:24:05 -05:00
Tobias Koppers 4d9d79c57e renamed enforce left/right to pre/post 2016-09-20 19:39:07 +02:00
Tobias Koppers a53799c0ac use new RuleSet matching instead of LoadersList
pass issuer via contextInfo
2016-09-15 00:22:10 +02: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 711a3822fa refactor ModuleFactory to take an object instead of multiple arguments 2016-07-20 12:51:03 +02:00
Tobias Koppers d5a24ced67 fixed #2006 2016-02-09 19:32:50 +01:00
Tobias Koppers e52b7b2e4d Resolve loaders from configuration relative to context instead of resource 2016-02-03 22:01:58 +01:00
Tobias Koppers 205d08cac5 fixes and performance improvements 2016-01-26 17:56:44 +01:00
Tobias Koppers f9ade28a9e allow to pass context info 2016-01-25 18:28:56 +01:00
Tobias Koppers fecf07dd1f integrated new enhanced-resolve version 2016-01-03 21:42:56 +01:00
Tobias Koppers 461c49ab66 updated partly to new enhanced-resolve API 2016-01-02 00:21:54 +01:00
Tobias Koppers ded70aef28 moves stuff from webpack-core to webpack-sources 2015-12-29 17:44:55 +01:00
Tobias Koppers 3201dc333d Merge branch 'webpack-1'
Conflicts:
	lib/NormalModuleFactory.js
	package.json
2015-11-13 21:58:38 +01:00
Tobias Koppers 6b60662068 performance improvement 2015-11-13 21:55:41 +01:00
Tobias Koppers 7cbd78c1da Merge branch 'master' into webpack-2
Conflicts:
	.travis.yml
	bin/config-optimist.js
	test/statsCases/define-plugin/expected.txt
2015-09-19 20:11:48 +02:00
Ahmet Katrancı 8ff6cb5fed Report constructor correctly when inheriting from Tapable 2015-08-18 12:35:57 +01:00
Tobias Koppers 431a4c791c Merge branch 'master' into webpack-2
Conflicts:
	hot/dev-server.js
	hot/only-dev-server.js
	hot/poll.js
	hot/signal.js
	lib/ChunkTemplate.js
	lib/HotModuleReplacement.runtime.js
	lib/HotModuleReplacementPlugin.js
	lib/JsonpMainTemplatePlugin.js
	lib/MainTemplate.js
	lib/NormalModule.js
	lib/Parser.js
	lib/RecordIdsPlugin.js
	lib/WebpackOptionsApply.js
	lib/dependencies/RequireEnsureDependency.js
	lib/node/OldNodeWatchFileSystem.js
	lib/optimize/OccurrenceOrderPlugin.js
	package.json
2015-07-17 09:30:37 +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
Tobias Koppers 66df34688e Merge branch 'master' into webpack-2
Conflicts:
	bin/convert-argv.js
	lib/webpack.js
2015-06-07 22:24:03 +02:00
Tobias Koppers 817e678d9a added DllPlugin and dll example 2015-05-16 18:27:59 +02:00
Tobias Koppers 11a578a36b Merge branch 'master' into webpack-2
Conflicts:
	lib/NormalModuleFactory.js
2015-05-16 14:59:50 +02:00
Tobias Koppers 5a5b732785 refactored ExternalsPlugins to plugin based approach
instead of decorator
2015-05-13 00:15:01 +02:00
Tobias Koppers f4b9d5f57a Merge branch 'master' into webpack-2
Conflicts:
	lib/Compilation.js
	lib/Compiler.js
	lib/DefinePlugin.js
	lib/HotModuleReplacementPlugin.js
	lib/Parser.js
	lib/node/NodeSourcePlugin.js
	lib/node/OldNodeWatchFileSystem.js
	package.json
2015-04-27 20:22:13 +02:00
Tobias Koppers cebd3b9722 added linting 2015-04-23 23:55:50 +02:00
Tobias Koppers 4a8bf92349 loader regExp compares to resourcePath instead of resource
#729
2015-03-05 21:45:08 +01:00
Tobias Koppers d80cdcefac Code Quality 2014-06-24 18:53:32 +02:00
Tobias Koppers 90daea5fdd pass context to after-resolve hook 2014-05-28 06:31:11 +02:00
Tobias Koppers 83eec78bf0 follow the browser-module spec: ignoring export an empty module.
fixes #187
2014-03-01 20:07:42 +01:00
Tobias Koppers a705802ae1 allow to ignore a file by browser field
fixes #186
2014-03-01 13:37:13 +01:00