Commit Graph

299 Commits

Author SHA1 Message Date
Tobias Koppers ef9e25d8ea report dependencies from resolver to the compilation
refactor NormalModuleFactory
2019-01-08 15:14:25 +01:00
Tobias Koppers b5db48291b add caching to FlagDependencyExportsPlugin 2018-12-31 12:29:01 +01:00
mc-zone ee2d69b901 refactor: remove useless return statement 2018-12-25 18:43:34 +08:00
mc-zone 97fdbbb6a9 feat: add compiler.afterDone hook triggered after other callbacks 2018-12-25 15:08:12 +08:00
Florent Cailhol e06b4853d6 Add compiler typings 2018-12-12 10:26:53 +01:00
Shah Kashani 217b2ad7e2 Fix for #8398 - call failed-hook on compilation errors 2018-11-21 11:16:25 -05:00
Florent Cailhol 9ffb4e45dc Replace Source#emitted by a WeakSet 2018-11-08 23:26:31 +01:00
Tobias Koppers d9a0d3a139 Merge tag 'v4.23.0' into next
4.23.0
2018-10-24 20:10:30 +02:00
Tobias Koppers af4cb35784
Merge pull request #8175 from cacheflow/add-tracking-of-removed-files
feat(Compiler): Add file removal tracking in watch-run
2018-10-24 10:44:40 +02:00
renatoagds 7e0ca7193d move watchMode trigger for watch in compiler and close in watching 2018-10-23 14:52:32 -03:00
renatoagds 2f7533202c adding watchMode flag in compiler 2018-10-22 19:23:47 -03:00
Lex Alexander 2cdf04e14b feat(Compiler): Add file removal tracking in watch-run
-Closes 5072.
2018-10-18 15:58:58 -07:00
Tobias Koppers ae72fe3724 fixes timestamp transfer from watcher 2018-09-27 21:28:07 +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 f31a8c231b add compilerPath (will be later used to access the cache) 2018-09-27 11:21:17 +02:00
Tobias Koppers 17044bf9c6 Merge tag 'v4.20.0' into next
4.20.0
2018-09-25 16:20:42 +02:00
Tobias Koppers d48975c948 use types from schema 2018-09-21 11:04:19 +02:00
Tobias Koppers 9da6003362 Make usedIds in records an array
Make emitted JSON for records stable
2018-09-06 16:05:29 +02:00
Tobias Koppers 3aa2280498 move Module.hash and .renderedHash into ChunkGraph 2018-08-22 19:24:54 +02: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
Tobias Koppers 0a06f19fd8 Merge tag 'v4.15.0' into next
4.15.0
2018-07-04 22:19:50 +02:00
Florent Cailhol 069534bb23 Remove unused import 2018-06-26 10:24:22 +02:00
Florent Cailhol c68d0d2171 Remove Tapable compatibility 2018-06-26 08:31:08 +02:00
Tobias Koppers c6c3eba1c0 remove type duplication 2018-06-25 16:36:59 +02:00
Tobias Koppers 763ce22aa7 spacing of hook list 2018-06-25 10:51:33 +02:00
Sean Larkin f64f75e55f revert function style, fix a few types, etc 2018-06-23 10:24:36 -04:00
Sean Larkin 1bae93852a
Merge branch 'master' into feature/type-compiler-compilation-save 2018-05-30 19:35:36 -07:00
Florent Cailhol 2a9452e51b Add brackets for multiline if/for statements 2018-05-29 15:45:44 +02:00
Tobias Koppers 342c3c6fec Merge branch 'master' into feature/type-compiler-compilation-save
# Conflicts:
#	yarn.lock
2018-05-24 18:56:04 +02:00
Florent Cailhol 252ac31a57 Improve JSON parse error 2018-05-19 11:09:30 +02:00
Sean Larkin 761d73b4e7 chore(types): add Compiler and Compilation type support 2018-05-15 15:04:38 +02:00
Mohsen Azimi 589f40b26a Add missing class member initializations found by TypeScript 2018-04-11 16:48:44 +02:00
Tobias Koppers 1b50e4e96d
Merge pull request #6833 from webpack/ellipsis
Use ellipsis instead of '...'
2018-03-29 11:00:28 +02:00
Mohsen Azimi d6b2515e0c
Remove extra argument passed to ContextModuleFactory in Compiler 2018-03-28 22:03:28 -07:00
Florent Cailhol 3983803d30 Destructure 'require' to improve readability 2018-03-22 12:05:58 +01:00
Florent Cailhol 72786beee7 Use ellipsis instead of '...' 2018-03-22 10:54:18 +01:00
Maksim ea6e173551 Move concurrent compilation error to separate class 2018-03-13 13:10:42 +03:00
Maksim 60a5edc48d Wrap callback in compiler's run method 2018-03-07 12:14:51 +03:00
Maksim Nazarjev 07c1f6d86f Prevent webpack from running twice at a time 2018-03-07 00:56:31 +03: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
Thibaut Dutartre af8de036b2 Transform done hook into async 2018-01-25 13:56:50 +01:00
Tobias Koppers d6816afddf
Merge pull request #6355 from webpack/for_of_loops
Use for-of loops instead of forEach
2018-01-24 10:35:58 +01:00
Tobias Koppers 9c8098c635
Merge pull request #6370 from webpack/remove_v3_deprecated
Remove v3 deprecated APIs
2018-01-24 09:43:10 +01:00
Tobias Koppers 7a1b357aad
Merge branch 'next' into for_of_loops 2018-01-24 09:01:31 +01:00
Florent Cailhol 7b8fa112e0 Remove v3 deprecated APIs 2018-01-23 23:25:01 +01:00
Florent Cailhol d4811b0d37 Use for-of loops instead of forEach 2018-01-23 22:53:18 +01:00
Evan Scott 1f29fa9b51 perf: refactor various timestamp caches into ES6 Maps
This change satisfies https://github.com/webpack/webpack/issues/6234
which desires to change the timestamp caches from plain objects to
the ES6 Map type to avoid deopts, since v8 expects things to be
added to Maps but objects are only fast if properties aren't added
dynamically after initial assignment.
2018-01-23 02:30:22 -05:00
Florent Cailhol 7f303e5260 Use Buffer.from instead of new Buffer 2018-01-22 17:23:34 +01:00
Tobias Koppers 18ae73dad4 Refactor chunk graph
Chunks are now always in ChunkGroups
ChunkGroups have parents and children, Chunks no longer have this
AsyncDependenciesBlocks point to a ChunkGroup instead of a list of chunks
Entrypoint is now a ChunkGroup (extends from it)
move stuff graph modification methods into GraphHelpers
Change chunk id recording to source-based
Chunks have parents, siblings and children in Stats
rename AutomaticCommonsChunksPlugin to SplitChunksPlugin
add request property to origin (ChunkGroup)
remove moveToParent from AggressiveMergingPlugin
fix issues with AggressiveSplittingPlugin
remove CommonsChunkPlugin
add optimization.runtimeChunk (RuntimeChunkPlugin)
fix a filename bug for initial chunks
remove extract-text-webpack-plugin from test suite
add DebugHash to help debugging hash issues
fix issues with entry modules in different chunk as runtime
redo optimization.splitChunks options
Compilation.entrypoints is now a Map
Compilation.chunkGroups has been added
remove some unittests
update examples
update tests with CommonsChunkPlugin
2018-01-19 19:21:30 +01:00
EugeneHlushko 2aab060f26 Refactor: indexOf >< checks to includes 2018-01-11 18:58:39 +02:00
Florent Cailhol 0014042c53 Move Watching to its own file 2017-12-31 18:16:03 +01:00
Florent Cailhol 7dd41b55c6 Replace deprecated Tapable#apply by Plugin#apply 2017-12-20 11:53:56 +01:00
Tobias Koppers 7d87f34269 Only create one RequestShortener per Compiler
move Compiler.context assignment into Compiler
2017-12-04 12:23:42 +01:00
Tobias Koppers fb689d9c32 Merge branch 'refactoring/plugin-system-compiler' into refactoring/plugin-system-all 2017-11-28 16:35:57 +01:00
Tobias Koppers 7787b4ad13 upgrade tapable for Compilation 2017-11-27 21:14:16 +01:00
Tobias Koppers 31e9625dfe upgrade tapable for Compiler 2017-11-27 21:01:44 +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 860da9baaa
Merge branch 'next' into refactor/sets 2017-11-08 21:28:51 +01:00
Tobias Koppers f7c2f8e470 Update code style to arrow functions 2017-11-08 11:56:01 +01:00
Tobias Koppers 2a22cbd43d code style fixes 2017-11-08 05:58:48 +01:00
Tobias Koppers 51c572c4f5 refactor more properties to Sets 2017-11-07 09:17:12 +01:00
doly mood bf8b691d9f fix: watch-run params should be compiler 2017-09-29 14:15:37 +08:00
Tobias Koppers 0975d13da7 assign correct cache to child compilation
fixes webpack-contrib/extract-text-webpack-plugin#612
2017-09-13 16:29:37 +02:00
Adam Thomann 15f4894ebe Convert bind(this) to arrow functions 2017-08-11 01:52:25 -04:00
Huang Chi-Han 6c0e4520ea Fix typo that causes "TypeError: this.compiler.compiler is not a function" since compiler is undefined. 2017-07-12 15:22:02 +08:00
Flavio Corpa 43f967cd11 Adjust style to es6 🎉 2017-07-12 08:03:22 +02:00
Flavio Corpa 8975d8ed09 Merge branch 'master' into master 2017-07-12 07:57:53 +02:00
Kyle Truong 79926b3eed - Edit PR to use normal functions again due to ‘arguments’ not working with arrow functions
- reverse timeout change back to normal in NodeWatchFileSystem.test.js
2017-07-07 10:52:07 -04:00
Kyle Truong 13bc80b1a4 - Put Watching as a property on Compiler rather than a static method 2017-07-07 09:11:15 -04:00
Kyle Truong 6dffccaa72 - Remove ‘self’ references from lib/Compiler and use more arrow functions instead 2017-07-07 09:11:15 -04:00
Kyle Truong 4378c92c60 - Add more tests 2017-07-07 09:11:15 -04:00
Kyle Truong f080ebe0ee - Add tests to Compiler and Watching 2017-07-07 09:11:15 -04:00
Kyle Truong 567868925d 4099 ES6 Refactor lib/Compiler.js 2017-07-07 09:11:15 -04:00
Tobias Koppers ee541d9ab3 Merge pull request #4704 from webpack/bugfix/child-records-cache
assign correct records and cache to child compilations
2017-05-16 14:35:03 +02:00
André Cruz b0c45da2fd Fix _done function not dealing with compilation being undefined 2017-05-06 00:35:39 +01:00
Tobias Koppers 101850c5a9 assign correct records and cache to child compilations
This is a breaking change because plugins or loader could rely on this incorrect behavior
When using child compilations plugins and loaders should use a unique compiler name or use a consistent order

fixes #2777
2017-05-04 13:05:03 +02:00
J Huang 6afc397b99 perf: use Date.now() instead of new Date().getTime()
new Date().getTime() is 2x slower than Date.now(), see https://jsperf.com/new-date-vs-date-now-vs-performance-now/6
2017-05-04 10:19:54 +08:00
Flavio Corpa 859e0ddab6 Replace 2 spaces with 1 tab 2017-05-03 14:54:50 +02:00
Flavio Corpa 2178f1ad50 Merge branch 'master' into master 2017-05-02 10:34:10 +02:00
Tobias Koppers 53bb15b1ed Merge pull request #3934 from timse/refactor-watching-in-compiler
Refactor _done of Watching in compiler
2017-04-23 12:10:20 +02:00
Flavio Corpa 4366ad81db Merge branch 'master' into master 2017-04-14 14:18:41 +02:00
kutyel af3422c5d6 Add callback to Watching.prototype.invalidate 2017-04-14 14:16:41 +02:00
e-cloud 07f6281185 fix: typos and variables/function misuse 2017-04-11 19:43:05 +08:00
Tim Sebastian ab30c6b1c0 pass stats to error handler again, to prevent breaking change 2017-04-08 09:13:38 +10:00
Tim Sebastian 2a1bcff9e6 refactor the _done method of Watching
- we can safely ignore the "else" cases of not having an error as _done() is only called without arguments if "this.invalid is true"
- if we get passed the point of `this.invalid` either `err` or `compilation` are !!always!! set. therefore later checks can again be ignored
- early return in error case
- ignore `this.error` if we make it passed the error as it will be unset at this point.
- remove the setting of `this.error` or `this.stats` as the only use is inside this method and only allow weird behaviour if someone set them from outside
2017-04-06 21:46:07 +10:00
Tim Sebastian 8165164d3e explicitly call `new Stats` with compilation
instead of having compilation.getStats returning a new instance of `Stats(this)`
2017-04-06 21:40:58 +10:00
Tobias Koppers 263c5c9f40 close watchers correctly when closing watching 2017-03-15 15:50:05 +01:00
James Newell 2dfdbad047 emit watch-close event when watcher closes 2017-03-06 14:32:34 +11: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
Sean Larkin 91c1f35e05 fix(node): rollback changes of Buffer.from to new Buffer() and bump down travis to 4.3 min node v 2017-01-16 23:57:27 -06:00
Tobias Koppers 8e69a80847 code linting 2017-01-11 12:29:01 +01:00
Sean Larkin 7327ee608a chore(eslint): added eslint-node-plugin (#3652) 2016-12-30 17:13:49 -06:00
Sean Larkin aa8d01bf8d refactor(eslint): Added no-unsed-vars, env specific .eslintrc's for buildin & hot (#3636)
* refactor(eslint): Added no-unsed-vars, env specific .eslintrc's for buildin & hot

* This change allows for buildin to now be part of the lint test by addition of an extra .eslintrc file which extends existing but sets es6 to false
* Turned on no-unused-vars for eslint, and then removed all warnings from turning that feature on
* Was getting notified of errors in "quote" property in eslintrc, so changed to correct value from error to 2.

* beautify

* swap invalid eslint config val
2016-12-30 09:43:49 -06: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
Raphael Mu 75caa169bc reduce fn.bind(this) usage by aliasing `this` to `self` (#3146) 2016-10-17 13:26:22 -05:00
Tobias Koppers 530fad43b4 allow to pass abs path to manifest property of DllReferencePlugin
manifest is loaded on compilation
2016-09-16 01:19:50 +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 2f618e733a refactoring and aggressive-splitting plugin 2016-07-13 11:03:14 +02:00
Tobias Koppers f5a5edd78d run purge before stats for cache #2003 2016-05-06 22:47:02 +02:00
Sharang Dashputre 8845a7dda7 Copy watchOptions properly in Compiler.js
Replace Object.create() with assign() from object-assign.
2016-04-22 01:11:37 +05:30
Daniel K 466d20890c Pass changed file into `invalid` plugin hook 2016-03-20 11:53:55 +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 ff7848369a Merge branch 'master' into webpack-2
Conflicts:
	bin/webpack.js
	package.json
2015-05-10 20:41:04 +02:00
Tobias Koppers 18f3595cde allow to pass watch options
deprecate old API
2015-05-10 13:50:15 +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 ab149eb4d4 Merge branch 'hot-multi-pass' of https://github.com/webpack/webpack.git into webpack-2
Conflicts:
	lib/Compilation.js
2015-03-05 22:30:24 +01:00
fresheneesz b271c10555 make Watching.close callback optional
https://github.com/webpack/webpack/issues/769#issuecomment-73615872
2015-02-09 16:02:36 -08:00
Tobias Koppers fb49376f6d Added multi pass hot mode #669 2015-01-30 00:46:52 +01:00
Tobias Koppers a979874cd0 updated deps, minor changes 2015-01-17 23:43:25 +01:00
Tobias Koppers adfcfce15f watching of missing files, fixed #668
store missing files from errors for missingDependencies
make the new watching plugins default
added OldWatchingPlugin
2015-01-17 21:55:44 +01:00
Corporateanon 87decf47d9 [fix] mkdirp is not called properly on Windows 2015-01-05 15:30:18 +02:00
Tobias Koppers f569a97ab4 fixed incorrect commit 2014-09-22 07:59:08 +02:00
Jason Anderson f371945a29 Add TemplatedPathPlugin 2014-09-11 15:31:08 +02:00
Tobias Koppers 9a8cae6d43 added `NoErrorsPlugin`, which doesn't emit on error
fixes webpack/webpack-dev-server#42
fixes #449
2014-09-03 14:16:17 +02:00
Tobias Koppers d80cdcefac Code Quality 2014-06-24 18:53:32 +02:00
Tobias Koppers b0caa69ae1 fixed file system purging 2014-06-11 22:52:02 +02:00
Tobias Koppers 44bb43854f Added experimental MultiCompiler
webpack(...) takes an array
support an array in webpack.config.js
2014-06-11 22:26:50 +02:00
Tobias Koppers 42c82f6b77 refactored ModuleTemplate to plugin interface 2014-06-03 08:45:26 +02:00
Tobias Koppers a0394a061b refactored ChunkTemplate with plugin interface 2014-06-02 23:40:50 +02:00
Tobias Koppers 3247725ba3 refactored MainTemplate to plugin interface 2014-06-02 21:23:53 +02:00
Tobias Koppers aa83dad8be don't ignore error 2014-05-13 07:31:43 +02:00
Tobias Koppers e6e0b75290 added Watching.close
fixed #249
2014-05-08 09:08:01 +02:00
Tobias Koppers 6e7bd0c60b allow querystring for assets, fixes #217 2014-03-31 08:45:45 +02:00
Tobias Koppers 9a0a8165a0 bug fix for #199 2014-03-11 18:42:51 +01:00
Tobias Koppers bf40067cba replace [hash] in output.path
fixes #199
2014-03-11 15:39:46 +01:00
Tobias Koppers b1fe88b531 fixed WebWorker with Hot Module Replacement #26 2013-06-20 12:04:31 +02:00
Tobias Koppers 7df05c7ddc fixed missing mkdirp for records, #90 2013-06-10 14:25:54 +02:00
Tobias Koppers f84f000149 records, typo 2013-05-31 12:22:40 +02:00
Tobias Koppers 209f96c543 added option to prefetch modules 2013-05-13 13:34:00 +02:00
Tobias Koppers 5cdb8cbf81 cache chunks, cache assets 2013-05-08 13:28:54 +02:00
Tobias Koppers 0de7c73ad8 SourceMap support 2013-03-26 16:54:41 +01:00
Tobias Koppers fd7226ed50 fixes 2013-02-04 15:58:04 +01:00
Tobias Koppers eda45fe115 fixed a bug 2013-02-04 14:44:34 +01:00
Tobias Koppers 68ee0a6537 some bugfixes and fallback option 2013-02-04 13:59:43 +01:00
Tobias Koppers 8079331b2f fixed child compiler 2013-02-04 13:16:12 +01:00
Tobias Koppers e8f0e1d7cf fix watching 2013-02-01 08:03:38 +01:00
Tobias Koppers 961ad40966 file watching 2013-01-31 18:00:22 +01:00
Tobias Koppers ee01837d66 Refactored everything for 0.9 2013-01-30 18:49:25 +01:00