Commit Graph

200 Commits

Author SHA1 Message Date
Tobias Koppers 82a71be1dc Cleanup, refactoring, types 2018-04-27 18:53:07 +02:00
Tobias Koppers f876564b84 Merge branch 'master' into feat-rewrite-wasm
# Conflicts:
#	test/statsCases/aggressive-splitting-entry/expected.txt
#	test/statsCases/aggressive-splitting-on-demand/expected.txt
#	test/statsCases/chunks-development/expected.txt
#	test/statsCases/chunks/expected.txt
#	test/statsCases/import-context-filter/expected.txt
#	test/statsCases/import-weak/expected.txt
#	test/statsCases/limit-chunk-count-plugin/expected.txt
#	test/statsCases/module-assets/expected.txt
#	test/statsCases/named-chunks-plugin-async/expected.txt
#	test/statsCases/optimize-chunks/expected.txt
#	test/statsCases/preset-detailed/expected.txt
#	test/statsCases/preset-normal/expected.txt
#	test/statsCases/preset-verbose/expected.txt
#	test/statsCases/scope-hoisting-bailouts/expected.txt
#	test/statsCases/scope-hoisting-multi/expected.txt
#	yarn.lock
2018-04-27 15:39:12 +02:00
Mohsen Azimi 42698d61e2
wat? 2018-04-08 10:26:04 -07:00
Mohsen Azimi 2ba7596eac
Pass file name as part of options hash to vm.runInThisContext 2018-04-08 09:47:30 -07:00
Sven SAULEAU 6f5560c5d5
Merge remote-tracking branch 'upstream/master' into feat-rewrite-wasm 2018-03-29 13:53:46 +02:00
Sven SAULEAU ee6b5d434c
style: fix indentation 2018-03-29 13:40:27 +02:00
Sven SAULEAU 0476eb4499
Merge branch 'master' into feat-rewrite-wasm 2018-03-29 12:35:48 +02:00
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Tobias Koppers 296542ed79 add [contenthash] support 2018-03-24 12:08:36 +01:00
Florent Cailhol 3983803d30 Destructure 'require' to improve readability 2018-03-22 12:05:58 +01:00
Sven SAULEAU 405fea6719
refactor: move specific stuff out of the base method 2018-03-14 19:05:05 +01:00
Fernando Montoya 10ffa3ebfb Merge branch 'master' into feat-rewrite-wasm 2018-03-14 18:50:33 +01:00
Sven SAULEAU c2f1c4f123
refactor: use base plugin for web and node 2018-03-14 16:13:03 +01:00
Sven SAULEAU 856695a1fd
refactor: use web wasm plugin for node 2018-03-14 15:02:09 +01:00
Florent Cailhol f9e7a17666 Escape module names 2018-03-06 09:24:07 +01:00
Josh Soref 581069bb56 spelling: uncaught 2018-02-26 02:50:05 +00:00
Josh Soref b39266121a spelling: assembly 2018-02-26 02:25:03 +00:00
Tobias Koppers f32bd41c52 fix linting 2018-02-25 02:15:37 +01:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Tobias Koppers edd8daf1d7 Merge branch 'master' into next
# Conflicts:
#	lib/optimize/ConcatenatedModule.js
#	package.json
#	yarn.lock
2018-02-09 17:04:33 +01:00
Anna Henningsen e4375f8833
Avoid relying on Node’s internals
`process.binding()` is not a public API, and should
not be used.

Luckily, Node recently introduced an API that does
exactly what Webpack needs:
https://nodejs.org/api/modules.html#modules_module_builtinmodules

So use that instead and keep the old path as a fallback.
2018-01-27 22:10:36 +01:00
Tobias Koppers 7a1b357aad
Merge branch 'next' into for_of_loops 2018-01-24 09:01:31 +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
Tobias Koppers ea609374f7 split Chunk.isInitial into isOnlyInitial and canBeInitial
remove includeInitial argument of getChunk(Module)Maps
2018-01-22 12:52:28 +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
Florent Cailhol 3fb63f94cc Deprecate System.import() parser plugin
- `system: undefined`: Warns if `System.import()` is used
- `system: true`: Disable warning
- `system: false`: Skip `System.import()` instrumentation
2018-01-18 11:34:02 +01:00
EugeneHlushko 2aab060f26 Refactor: indexOf >< checks to includes 2018-01-11 18:58:39 +02:00
Tobias Koppers 74a8c45ea1 add getContext/FileTimestamps to watcher
get timestamps on invalidate

fixes #5970
2018-01-03 13:01:27 +01:00
Florent Cailhol 9669c9e013 Use Parser#hooks instead of Tapable#plugin 2017-12-21 09:08:10 +01:00
Florent Cailhol 7dd41b55c6 Replace deprecated Tapable#apply by Plugin#apply 2017-12-20 11:53:56 +01:00
Florent Cailhol 08ddad2e10 Replace NormalModuleFactory#plugin() calls 2017-12-14 14:42:49 +01:00
Florent Cailhol f737b26260 Remove some plugin calls 2017-12-14 14:42:49 +01:00
Tobias Koppers 91e6692362 extract exports from wasm module
mangle used exports
fix esm flag
2017-12-14 13:05:03 +01:00
Tobias Koppers 86786811e4
Merge pull request #6085 from webpack/refactor/static-template
make all methods on Template static
2017-12-08 17:59:15 +01:00
Florent Cailhol 36c690d37f Use tapable instead of 'plugin' 2017-12-08 14:23:31 +01:00
Tobias Koppers 16ee68b5f9 make all methods on Template static 2017-12-07 09:49:50 +01:00
Tobias Koppers 56328a7cab upgrate tapable in Templates 2017-11-28 18:43:01 +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 f7c2f8e470 Update code style to arrow functions 2017-11-08 11:56:01 +01:00
Tobias Koppers 6bd937d768 make things consitent 2017-09-22 14:07:28 +02:00
Tobias Koppers f6a0d51e6b Merge branch 'master' into use-set-in-chunks 2017-07-18 09:32:53 +02:00
Tobias Koppers e72c3b22c8 missing dependencies could be files too 2017-07-15 10:27:01 +02:00
Tim Sebastian 7972859640 refactor chunk.chunks usage to check for chunk existance 2017-06-24 11:39:46 +10:00
Anatoliy Yastreb cd2f022d43 Refactor: remove unnecessary quote escaping 2017-06-20 10:05:55 +09:00
Anatoliy Yastreb 7f1d60d709 Refactor: string concatenation to template literals 2017-06-20 00:18:59 +09:00
Anatoliy Yastreb c84aa45e98 Refactor: bound functions to arrow functions 2017-06-19 17:46:42 +09:00
Anatoliy Yastreb aa833bf1b4 Refactor: ES6 lib/node/NodeMainTemplatePlugin.js #4099 2017-06-19 17:35:05 +09:00
Joel Chen 8fec262c8c Support turn off NodeSourcePlugin with false option 2017-06-02 23:04:23 -07:00
Orlando Wenzinger 5e1cedf93b replace let with const for variables with no reassignment 2017-05-06 22:16:50 +02:00
Orlando Wenzinger 6d75f833c7 ES6 refactor of NodeSourcePlugin 2017-05-06 20:41:26 +02:00
Tobias Koppers 263c5c9f40 close watchers correctly when closing watching 2017-03-15 15:50:05 +01:00
Tobias Koppers f84412cfb2 allow watcher to detect removals
fixes #4162
maybe fixes #4079
maybe fixes #1533
2017-03-15 15:50:05 +01:00
Tim Sebastian d056ba7d40 extract `buildExpression` to ParserHelpers.addParsedVariableToModule
rewrite affected modules
2017-02-25 00:26:07 +11:00
Will Mendes ee81ebf73c refactor(NodeOutputFileSystem): upgrade to ES6 2017-01-27 10:04:02 +11:00
Tobias Koppers 0f4d927803 rewrite to arrow functions 2017-01-25 23:39:32 +01:00
Will Mendes d9daaea001 refactor(NodeWatchFileSystem): upgrade to ES6 2017-01-24 23:21:42 +11:00
Will Mendes ff8bf5709b refactor(NodeTargetPlugin): upgrade to ES6 2017-01-11 23:09:19 +11:00
timse 86c00207bd Extract to parser helpers (#3843)
* rename ModuleParserHelpers to ParserHelpers

- rename module and file from ModuleParserHelpers to ParserHelpers
- change imports and usages
- rename addParsedVariable to addParsedVariableToModule to add module context again

* introduce setTypeof helper to ParserHelpers

* switch setTypeof in amdplugin - use ParsersHelpers instead

* switch setTypeof in CommonJsPlugin - use ParsersHelpers instead

* switch setTypeof in SystemPlugin - use ParsersHelpers instead

* add ParserHelpers.expressionIsUnsupported method

* use ParserHelpers.expressionIsUnsupported in SystemPlugin and NodeStuffPlugin

* refactor setTypeOf to more atomic helper methods

- reduces sideeffects as parser is called outside of helper
- allows better reuse

* use ParserHelper on more pieces in CommonJsPlugin making BasicEvaluatedExpression obsolete

* switch new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) in dependencies to ParserHelpers

* switch other new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) to ParserHelpers

* rename wrongly named function - name anonymous functions
2017-01-08 12:11:26 -06:00
Shubheksha Jalan 5aa522d5be refactor(ES6): upgrade NodeHotUpdateChunkTemplatePlugin to ES6 (#3795) 2017-01-07 22:07:59 -06:00
Oleg Pimenov 6b2c35c533 refactor(plugins): upgrade to ES6 NodeChunkTemplatePlugin & NodeTemplatePlugin (#3792) 2017-01-07 10:06:08 -06:00
Shubheksha Jalan efc576c8b7 refactor(ES6): upgrade NodeEnvironmentPlugin to ES6 (#3796) 2017-01-05 23:02:52 -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
Kees Kluskens 644e3a009b Upgrade eslint (#3626)
* Upgrade eslint

* Pin down eslint version

* Temporary fix for difference between js-beautify and eslint

js-beautify suddenly requires a space between `while` here,
but everywhere else we use it without space.

* Remove redundant rules (present in eslint:recommended)

* Add rules comparable to js-beautify rules to eslint

* Add some forgotten files

* Ugh, fix some differences between eslint and js-beautify the nuclear way

* Add back variables
2016-12-29 10:10:41 -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 8da6f6c81a don't shim shims and update node-libs 2016-11-23 11:31:24 +01:00
Alan Zhang 2e62b1207d Prefix path with ./ 2016-11-12 22:19:57 +08:00
Alan Zhang d4b73ec846 Apply change to Buffer, setImmediate, clearImmediate too. 2016-11-12 01:58:50 +08:00
Alan Zhang f9502b6612 Replace '\' with '/' to make windows generate same path string as other platforms. 2016-11-12 01:42:00 +08:00
Alan Zhang 4d1d18575b Change absolute path returned by getPathToModule() to relative path to fix issue #2215 2016-11-11 03:56:13 +08: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 78a2f699e2 beautify 2016-09-15 00:50:07 +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 afd11259b2 stricter linting and bug fixes 2016-09-15 00:22:10 +02:00
Tobias Koppers 1675a5a5ca new way to handle new ids, reuse old ids
adjusted HMR to handle id reusing
2016-07-18 00:41:26 +02:00
Tobias Koppers f5a5edd78d run purge before stats for cache #2003 2016-05-06 22:47:02 +02:00
Tobias Koppers 2ff9a247e2 better global support, even in strict mode 2016-05-06 11:36:36 +02:00
Tobias Koppers 902220a0ea smaller bundles by using module.e instead of module.exports
same for module.loaded and module.id
2016-02-13 13:11:34 +01:00
Tobias Koppers c838656e7f moved defaults for options.output into central place 2016-01-06 23:02:25 +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 b296e5a08c use options object for NodeTemplatePlugin 2015-11-20 08:38:15 +01:00
Tobias Koppers 7887d614b0 fixed test and comment 2015-07-25 15:37:48 +02: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
Avi Haiat daff7440a6 feat(app): Fix some obvious lint errors and warnings 2015-07-08 15:52:41 +03:00
Tobias Koppers 2245c4acca Promise based chunk loading API
don't flag entry module with `0` id anymore
use extra argument in chunk instead
this allows to require entry points
2015-06-13 11:45:28 +02: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 6c1eb49539 separated runtime code from compiler code
for better coverage data
2015-04-28 23:38:41 +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 a2af69056a Remove old stuff 2015-03-05 21:48:16 +01:00
Tobias Koppers d2b1bca5d9 Remove compatibly mode for node.Buffer
#729
2015-03-05 21:46:54 +01:00
Tobias Koppers 5ca01e92f4 test case for resolving node buildin libs
webpack/webpack#747
2015-02-04 23:22:28 +01:00
Tobias Koppers 7da31b2990 change `node.Buffer` in a way that is backward-compatible
#709
2015-01-21 20:25:25 +01:00
Tobias Koppers a979874cd0 updated deps, minor changes 2015-01-17 23:43:25 +01:00