Commit Graph

316 Commits

Author SHA1 Message Date
Yuta Hiroto ad51d66e95 feat(WebpackOptions): add default value and set UrlModulesPlugin
default: [hash].[ext]
2019-07-17 11:46:25 +02:00
Tobias Koppers b2e7837288 replace Object.assign with object spread 2019-06-19 13:16:05 +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 12a3e7c854 create experiments for importAwait importAsync and (a)syncWebAssembly 2019-06-05 13:32:22 +02:00
Tobias Koppers faa56f1751 move plugin into folder 2019-06-05 12:07:20 +02:00
Tobias Koppers 1977cb1036 move async module flag to ModuleGraph 2019-06-05 11:15:25 +02:00
Tobias Koppers de61023616 add side-by-side wasm support based on async modules
type: "webassembly/async-experimental"
remove i64 importing limitation since it will have BigInt integration eventually
update wasm example
2019-06-04 23:28:56 +02:00
Tobias Koppers 09f2fa7273 Merge tag 'v4.33.0' into next
4.33.0
2019-06-04 23:23:25 +02:00
OJ Kwon 2ec75c1cdb
feat(target): support electron preload async chunk loading 2019-05-25 18:02:00 -07:00
Tobias Koppers 14d95e30cb Merge tag 'v4.32.1' into next
4.32.1
2019-05-22 13:36:26 +02:00
Tobias Koppers 5b08ab51c3 fixes #9156
node: false should not disable CommonJs features
2019-05-22 08:03:44 +02:00
Tobias Koppers b34da271a1 add sync mode for chunk dependency startup in sync node target
fixes #9154

allow nesting webpack bundles (rename inner __webpack_require__)
to allow testing this
2019-05-20 22:53:58 +02:00
Tobias Koppers abc825d58f Merge tag 'v4.32.0' into next
4.32.0
2019-05-20 14:46:31 +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 b66143f706 Merge tag 'v4.30.0' into next
4.30.0
2019-05-09 21:34:28 +02:00
Alan Zhang 269efb9fd7 Never apply NodeStuffPlugin when "node" set to false 2019-04-24 10:40:51 +08:00
Igor Osipov cff0e18ec7 Make lazy loading for modules at WebpackOptionApply.js 2019-03-22 22:28:15 +03:00
Tobias Koppers 7ed1a8f88d
Merge pull request #8890 from timneutkens/add/option-to-disable-amd
Allow options.amd to disable AMDPlugin/RequireJsStuffPlugin
2019-03-15 09:45:54 +01:00
Connor Davis bf020dfe7b
Do the same for the rest of the plugins 2019-03-11 16:26:05 -05:00
Connor Davis 23687c6336
Only require if needed 2019-03-11 16:18:50 -05:00
Tim Neutkens 001960600d Run yarn fix 2019-03-10 17:13:53 +01:00
Tim Neutkens d02817619f Allow options.amd to disable AMDPlugin/RequireJsStuffPlugin
Introduces a new value `false` for `options.amd` that disables AMD support completely.

This would mainly be useful in for example ncc, Next.js etc where it’s either fully commonjs/esmodules (ncc) or fully esmodules (Next.js)
2019-03-10 16:31:35 +01:00
Tobias Koppers 180f912493 Merge tag 'v4.29.2' into next
4.29.2
2019-02-06 15:37:11 +01:00
Tobias Koppers b25ff237bb Prettify source code 2019-02-05 10:08:45 +01:00
Tobias Koppers 6fc0b96c9c add MangleExportsPlugin and options 2019-01-31 11:41:30 +01:00
Tobias Koppers 7c0d845af3 Refactor FileCachePlugin into multiple modules 2019-01-25 19:21:45 +01:00
Tobias Koppers 0f7355e170 Merge tag 'v4.28.4' into next
4.28.4
2019-01-10 16:51:17 +01:00
Tobias Koppers f446bf8a9b add ability to load dependent chunks for non-web targets
This allows to use `splitChunks` for initial chunks in i. e. node and webworker targets
2018-12-29 12:48:59 +01:00
Tobias Koppers d8ab512c34 Merge pull request #8565 from NaviMarella/ProfilingPlugin_8503
Fixed error in Profiling Plugin, if given folder path doesn't exist.
2018-12-29 04:47:17 -05:00
Tobias Koppers 77c2e61a31 remove memory cache from FileCachePlugin
support layers of caches
2018-12-27 20:57:54 +01:00
Tobias Koppers 123b0a64e7 add plugin system for Stats presets, defaults, creation and printing 2018-12-18 22:07:14 +01:00
Florent Cailhol 9caaa664f7 Refactor webpack main 2018-12-09 15:32:03 +01:00
Tobias Koppers ca46218787 add defaults for deterministic id plugins 2018-12-07 14:47:25 +01:00
Tobias Koppers 8281667668 improve ids for Long Term Caching
add deterministic chunk ids and make it default
StatsTestCases no longer need to explicitly use natural ids as the defaults are deterministic now too
add concept of id name hints for chunks
add `idHint` option to splitChunks to provide a hint
deduplicated code from different id plugins to IdHelpers
improve behavior of named ids in case of conflicts
remove `name: true` and `automaticNamePrefix` from splitChunks it's not as good as expected
improve named chunk ids to show root modules
2018-12-07 12:26:35 +01:00
Tobias Koppers f753f92c28 ensureChunk to RuntimeModule
step 1: non HMR cases
2018-11-29 16:16:39 +01:00
Tobias Koppers 7c37a6a972 handle runtime requirements 2018-11-29 16:07:17 +01:00
Florent Cailhol caefde17ab Remove devtoolLineToLine and lineToLine options 2018-11-12 14:26:31 +01:00
Tobias Koppers 2688b5b17f add resolver cache 2018-10-30 15:43:26 +01:00
Tobias Koppers a852828279 add persistent caching prototype 2018-10-17 21:25:39 +02:00
Florent Cailhol 7669104f71 Deprecate moduleIds=hashed in favor of moduleIds=deterministic
Also remove moduleIds=total-size
2018-10-12 17:14:16 +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 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 56c613a669 add moduleIds deterministic for simpler long term caching 2018-09-18 17:49:19 +02:00
Tobias Koppers b4860ccebb refactor chunk id plugins 2018-09-05 14:28:52 +02:00
Tobias Koppers 4d7b5b3b5e Refactor module id plugins to be independent 2018-09-03 20:45:44 +02:00
Florent Cailhol 8fda6a562e Add NaturalModuleIdsPlugin 2018-09-03 20:12:55 +02:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Florent Cailhol 0448c1c338 Use chunkIds and moduleIds 2018-07-14 21:59:42 +02:00
Tobias Koppers 9f0056b10d
Merge pull request #7686 from webpack/feature/module-chunk-ids-option
add new options moduleIds and chunkIds
2018-07-10 10:19:03 +02:00
Tobias Koppers 3fc4eb752f add new options moduleIds and chunkIds
deprecate namedModules, hashedModuleIds, namedChunks
add a lot of TODOs for webpack 5
split OccurenceOrderPlugin into separate plugins for modules and chunks
add NaturalChunkOrderPlugin and enable it in development
2018-07-09 15:06:19 +02:00
zroug b892065db0 Added support for WebAssembly modules when target is `electron-renderer` 2018-07-09 14:39:48 +02:00
Tobias Koppers 39d0bcb595
spacings 2018-06-07 14:22:35 +02:00
Tobias Koppers 5c604f93f6
Merge branch 'master' into feat-implement-option-for-hashed-module-ids-plugin 2018-06-07 14:21:09 +02:00
Mrkou47 d6d7119778 change variable defined identifier let to const 2018-06-07 14:37:08 +08:00
Tobias Koppers 8e3be48da4 allow to disable wasm import mangle
disable it by default (temporary)
2018-06-05 23:49:02 +02:00
Tobias Koppers 78b31936c3 add checkWasmTypes flag, enabled it only in production 2018-06-04 20:14:08 +02:00
Sven SAULEAU 928d051aae
Merge remote-tracking branch 'upstream/master' into fix-wasm-check-for-invalid-signatures 2018-05-30 15:31:31 +02:00
Sven SAULEAU fbd9d0d3a8
feat(wasm): add finalizer for checking exports 2018-05-30 12:45:05 +02:00
Florent Cailhol 2a9452e51b Add brackets for multiline if/for statements 2018-05-29 15:45:44 +02:00
evilebottnawi c222a6f33b feat: implement option for `HashedModuleIdes` plugin 2018-05-25 16:41:20 +03:00
Tobias Koppers 82a71be1dc Cleanup, refactoring, types 2018-04-27 18:53:07 +02:00
Tobias Koppers d91caea860 Pretty files for updated prettier version 2018-04-26 20:14:45 +02:00
Florent Cailhol eebf0866a9 Use correct function arity 2018-04-04 08:53:58 +02:00
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
EugeneHlushko 9cf9e3e2b3 Bugfix #6051: add `original-fs` to externals for electron targets 2018-02-18 13:27:46 +02:00
Tobias Koppers 9599e4eb61 fix typo: mergedDuplicateChunks -> mergeDuplicateChunks 2018-02-13 12:41:30 +01:00
Ben Rothman c26c872bb2 add "single" option to RuntimeChunkPlugin 2018-01-26 22:03:56 -06: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
Tobias Koppers 7112943ca4
Merge pull request #6298 from EugeneHlushko/refactor/indexof-to-includes
Refactor/indexof to includes
2018-01-11 22:45:02 +01:00
EugeneHlushko 2aab060f26 Refactor: indexOf >< checks to includes 2018-01-11 18:58:39 +02:00
Tobias Koppers acdabb1427 linting, comment and minor improvements 2018-01-10 19:22:25 +01:00
Tobias Koppers 85acfeb1c2 allow to use new options minSize, maxRequests 2018-01-10 18:58:27 +01:00
Tobias Koppers b34663cb2d add more config options
fix bugs
2018-01-10 18:58:27 +01:00
Tobias Koppers 417044f065 add AutomaticCommonsChunksPlugin
enable it by default for async chunks
add options for initial chunks
2018-01-10 18:58:26 +01:00
Tobias Koppers d95f93f8cb add output.globalObject configuration option
remove deprecated atom and electron target
add self libraryTarget
add self external type
2017-12-27 18:46:37 +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
Tobias Koppers 2148f556a4 Enable minimizing in production mode 2017-12-14 00:06:56 +01:00
Tobias Koppers fabe631a83 Only generate portable records when needed 2017-12-01 11:27:03 +01:00
Tobias Koppers 31e9625dfe upgrade tapable for Compiler 2017-11-27 21:01:44 +01:00
Tobias Koppers 2201b860a5 Add mode option and choose defaults depending on mode
add optimization options
use development mode for watch/hot/config tests
use production mode for integration/stats tests
create output directory if not existing
move __esModule to runtime
fix dependency behavior for cases without usedExports
2017-11-24 08:17:17 +01:00
Tobias Koppers 5e39ec46ee Allow to override resolve configuration 2017-11-18 08:12:35 +01:00
Tobias Koppers 982e44f670
Merge branch 'next' into master 2017-11-16 14:17:29 +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 4597805222
Merge branch 'next' into master 2017-11-11 19:00:05 +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
Stephan Badragan 68acd41bff passing namespace argument to contructors of dev tool plugins 2017-10-19 13:23:28 -07:00
Stephan Badragan 72b28aa1c3 passing devtoolNamespace through instead of setting it statically 2017-10-18 23:30:37 +01:00
Stephan Badragan f925032d5a adding `output.devtoolNamespace` option
When loading multiple libraries built with webpack, you can run into
collisions of the sourcemap file paths. For examle, both have
"webpack:///src/index.js".

This change addresses the problem by introducing a new output option
`output.devtoolNamespace` which defaults to `output.library` when
not specified. The defaults moduleFilenameTemplates in all the
sourcemap plugins have been modified to start with:
"webpack://[namespace]/...", where [namespace] will be replaced by
the `output.devtoolNamespace`.

Notice that there are only two slashes following "webpack:" now.
This is to make it behave just as before when not building with a
namespace. When building with a namespace you only get the two
slashes, but from what I've seen the chrome dev tools only care
about the first 2 slashes anyways.

Discussed with sokra here:
https://github.com/webpack/webpack/issues/5767
2017-10-18 01:14:40 +01:00
Tobias Koppers c383d5ea7f rename `pure-module` to `side-effects` 2017-09-14 15:12:36 +02:00
Tobias Koppers 7ceac63f07 add support for pure modules 2017-09-14 09:44:42 +02:00
Tobias Koppers 215647d9fc Merge pull request #5193 from dmvjs/ke/loader-target-plugin-use-options-target-where-possible
not using duplicate strings where it is easy to do so
2017-07-01 14:52:31 +02:00
Kirk Elliott c54a538d6b not using duplicate strings where it is easy to do so 2017-06-30 11:41:45 -04:00
Tobias Koppers 8ad6d27dab Merge pull request #4987 from webpack/feature/library-default-export
allow to export properties/exports for a library
2017-06-02 16:04:59 +02:00
Tobias Koppers de8fc51a6f allow to export any property/export of the bundle
fixes #3929
2017-06-02 14:52:41 +02:00
Tobias Koppers 765e97135b allow context to resolve to index.js files
fixes #3873
2017-06-02 13:41:25 +02:00
Aeneas c392f55ec8 Split sourceMappingURL string
This change is splitting `sourceMappingURL` to `source" + "MappingURL` in order to avoid syntax errors caused by babel when importing webpack in code that is transpiled by babel. This workaround was suggested in https://github.com/babel/babel/issues/4012 and this issue is an upstream to https://github.com/electron/electron-compilers/issues/67 and https://github.com/electron/electron-compile/issues/210 .

Apart from a small syntax change there are no changes to the functionality.
2017-04-17 10:02:36 +02:00
e-cloud 52055ba07e refactor: dead code elimination
remove those code not defined but used;
remove unused code
2017-04-11 19:43:05 +08:00
SendilKumar N 4500b10140 refactor(es6): WebpackOptionsApply 2017-02-21 21:49:15 +08:00
Tobias Koppers 9380bd4c12 Bugfix/disable module in harmony (#3755)
* moved format location into separate file
allow dependencies to report errors too

* NullDependencies do not change the hash

* dependencies can opt-out from `__webpack_require__` param

* apply module syntax plugins earlier

* emit errors if using AMD or CommonJS syntax in harmony modules
2017-01-09 10:11:34 -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 b46da21589 move plugins before environment 2016-12-21 22:56:04 +01:00
Tobias Koppers f4ab7fc7e2 more performance improvements 2016-12-14 16:22:54 +01:00
Tobias Koppers 37b7474651 Refactoring, make options simpler
breaking change: performance options changed
2016-12-14 11:33:57 +01:00
Tobias Koppers a148d6e754 Merge pull request #3350 from webpack/feature/custom_stats
feat(performance): webpack performance budgets
2016-12-07 23:11:29 +01:00
Sean Larkin 44f6f07ec2 chore(performance): cleanup logic errors, reformat test expects with new colomn [big] format if empty 2016-12-07 17:22:20 +01:00
Sean Larkin c6850b3481 chore(performance): cleaned up unused variables, removed compilation from constructor, added stats additional messages 2016-12-07 17:22:20 +01:00
Sean Larkin 52bfdab526 feat(perf): added initial setup for perf plugins, need to configure test cases and stats output based on perf props 2016-12-07 17:21:17 +01:00
Tobias Koppers 5225c000c1 fixes --cache and --no-cache 2016-12-07 16:18:33 +01:00
Tobias Koppers 11eefd5841 added import(), fixes #3098 2016-12-03 11:50:44 +01:00
Tobias Koppers e896d14829 MultiCompiler with compilers depend on other 2016-09-16 01:20:34 +02:00
Tobias Koppers afd11259b2 stricter linting and bug fixes 2016-09-15 00:22:10 +02:00
Tobias Koppers 19eabc7bb6 track which exported are provided by the modules
star export is filtered by provided exports

fixes #2953
2016-09-05 23:41:03 +02:00
Sean Larkin 5b250242bd Merge 2016-06-08 10:22:25 -05:00
e-cloud 13322ca35c add missing constructors for all classes needed
As i walk through the source, i've tried to trace the webpack running stack.
Then, i find the missing constructors result in uncleasr stack and create a patch
for them.
2016-05-20 13:39:36 +08:00
Tobias Koppers b98debb809 keep strict mode even if code is inserted
fixes #1970
2016-05-05 17:45:58 +02:00
Tobias Koppers 1b459d91f5 move externals into chunk with entry
fixes #2314
maybe fixes #2066
fixes #2375
fixes #1673
2016-05-05 10:13:50 +02:00
Tobias Koppers 5d981fe3d5 Option noSources that removes sourcesContent from sourcemaps. Also available as "nosources" in devtool option.
Picked from #2213
2016-04-10 23:37:17 +02:00
C. T. Lin 7a8743bde2 Correct Electron built-in module list
Correct built-in module list for electron main and renderer process: v0.37.3 document http://electron.atom.io/docs/v0.37.3/
2016-04-03 16:39:03 +08:00
Sean Larkin b607e97124 Adding auxiliary comments option for UMD wrapper 2016-02-26 14:25:53 -06:00
Kenny Tran eebc5ceaf6 Fix no-redeclare in code 2016-01-18 18:57:42 -08:00
Evan You d01c6b63da fix eval-source-map failing when source ends with comment 2016-01-05 10:41:59 -05:00
Tobias Koppers 461c49ab66 updated partly to new enhanced-resolve API 2016-01-02 00:21:54 +01:00
Nikita Khomyakov 0b9601e07e Add missing Electron built-in modules
Add `ipc-renderer` and `ipc-main` to the list of Electron's external modules
2015-12-11 13:15:19 +02:00
Tobias Koppers d5e8ec7901 fixed syntax from previous commit 2015-11-20 20:15:03 +01:00
Tobias Koppers 544079725e Merge pull request #1651 from leftstick/master
add electron to both electron and electron-renderer target
2015-11-20 17:26:43 +01:00
Tobias Koppers b296e5a08c use options object for NodeTemplatePlugin 2015-11-20 08:38:15 +01:00
Howard.Zuo 962e3902c8 add electron to both electron and electron-renderer target 2015-11-20 11:12:03 +08:00
Tobias Koppers 20e0f785bc Merge pull request #1467 from chentsulin/patch-1
`electron-main` and `electron-renderer` targets
2015-11-15 00:39:15 +01:00
Tobias Koppers 0f2f71492f Merge pull request #1523 from jhen0409/patch-1
Fix module of electron target: web-view -> web-frame
2015-11-07 21:28:50 +01:00
Jhen 32d457eee9 Keep web-view to support older electron versions 2015-11-01 02:42:37 +08:00
Tobias Koppers 6307ed72ac Added experimental usage tracking of ES6 modules and example 2015-10-21 21:05:01 +02:00
Jhen cf9ed59ee8 Fix module of electron target: web-view -> web-frame 2015-10-19 19:54:48 +08:00
C. T. Lin f8700060ed `electron-main` and `electron-renderer` targets 2015-09-23 00:20:31 +08: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
Stephan Florquin 00b4c539ca Add native-image plugin to electron target 2015-09-05 20:08:59 +02:00
Espen Volden db21a79587 Add option `umdNamedDefine` to toggle naming 2015-08-26 11:50:42 +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
Tobias Koppers d98df52a49 added System.import API and async context 2015-07-01 00:19:52 +02: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 28aa3624a4 Merge pull request #1060 from webpack/multi-build
Multiple build support
2015-05-30 02:37:25 +02:00
Alberto Leal 4018f5a519 backwards compatibility for atom 2015-05-28 21:53:38 -04:00
Alberto Leal e43f1a41f3 rename atom to electron 2015-05-22 23:14:41 -04:00
Tobias Koppers 94ba35cb13 Merge branch 'master' into webpack-2
Conflicts:
	lib/WebpackOptionsApply.js
2015-05-22 00:19:16 +02:00
Tobias Koppers a0938d728f simpler EvalDevTool 2015-05-18 21:59:01 +02:00