Update webpack in /packages/generator/app/templates from 3.11.0 to 4.0.0 #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dependencies.io has updated
webpack(a npm dependency in/packages/generator/app/templates) from "3.11.0" to "4.0.0".4.0.0
Big changes
modeor--mode) between two modes now: production or developmentoptimization.*(build your custom mode)process.env.NODE_ENVare set to production or development (only in built code, not in config)nonemode which disables everythingimport()always returns a namespace object. CommonJS modules are wrapped into the default exportimport()NoEmitOnErrorsPlugin->optimization.noEmitOnErrors(on by default in production mode)ModuleConcatenationPlugin->optimization.concatenateModules(on by default in production mode)NamedModulesPlugin->optimization.namedModules(on by default in develoment mode)CommonsChunkPluginwas removed ->optimization.splitChunks,optimization.runtimeChunktype: "javascript/auto"when transforming JSON via loader to JSBig features
javascript/esmhandles ESM more strictly compared tojavascript/auto:defaultimport, everything else (including namespace import) emit errors.mjsmodules arejavascript/esmby defaultimport()sideEffects: falseis now supported in package.jsonsideEffectsin package.json also supports glob expressions and arrays of glob expressionsoptimization.splitChunksoption was introducedDetails: https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
import()occur in a dead branchwebpackIncludeandwebpackExcludeare supported by the magic comment forimport(). They allow to filter files when using a dynamic expression.System.import()now emits a warningRule.parser.system: trueSystem.importwithRule.parser.system: falsemodule.rules[].resolve. It's merged with the global configuration.optimization.minimizehas been added to switch minimizing on/offoptimization.minimizerhas been added to configurate minimizers and optionswebpack-clito use the CLI--progress) now displays plugin namesFeatures
module.rules[].typeoptions.dependenciesconfigurations now throw errorsideEffectscan be overriden via module.rulesoutput.hashFunctioncan now be a Constructor to a custom hash functionoutput.globalObjectconfig option to allow to choose the global object reference in runtime exitCodetypeandrequest.includetestandexcludeto the eval source map devtool pluginfor ofinstead offorEachMapandSetinstead of Objectsincludesinstead ofindexOftext/javascriptandasyncas this are the default values (saves a few bytes)__webpack_require__and argument is omitted.wasm,.mjs,.jsand.jsonextensions in this orderoutput.pathinfois now on by default in develoment modeentrydefaults to./srcoutput.pathdefaults to./distproductiondefaults when omiting themodeoption<{parents}>>{children}<and={siblings}=in StatsbuildAttime to statsimport()now emits a error instead of a warningdoneis now an async hookBugfixes
*/output.chunkCallbackNameto the schema to allow configurating WebWorker templatemodule.id/loadednow correctly bails out of Module Concatentation (Scope Hoisting)Watching.invalidate-!behavior with post loadersrunandwatchRunhooks forMultiCompilerthisis now undefined in ESMvar,constorletjavascript/dynamicorjavascript/moduleis used.buildMetaof nulloriginal-fsmodule for electron targetspluginsInternal changes
plugincalls withtapcalls (new plugin system)buildMeta.exportsType: "default"for json modulesneo-asyncinstead ofasyncRemoved features
module.loadersloaderContext.optionsCompilation.notCacheableflagNoErrorsPluginDependency.isEqualResourceNewWatchingPluginCommonsChunkPluginBreaking changes for plugins/loaders
pluginmethod is backward-compatibleCompiler.hooks.xxx.tap(<plugin name>, fn)nowChunk.chunks/parents/blocksare no longer Arrays. A Set is used internally and there are methods to access it.Parser.scope.renamesandParser.scope.definitionsare no longer Objects/Arrays, but Map/Sets.StackedSetMap(LevelDB-like datastructure) instead of ArraysCompiler.optionsis no longer set while applying pluginsDependency.getReference()may now return aweakproperty.Dependency.weakis now used by theDependencybase class and returned in the base impl ofgetReference()ModulesContextModuleandresolveDependenciesCompiler.resolversintoCompiler.resolverFactoryaccessible with pluginsDependency.isEqualResourcehas been replaced withDependency.getResourceIdentifierTemplateare now staticoutputOptionsandrequestShortenerhas been moved to this classModule.metahas been replaced withModule.buildMetaModule.buildInfoandModule.factoryMetahave been addedModulehave been moved into the new objectsloaderContext.rootContextwhich points to thecontextoptions. Loaders may use it to make stuff relative to the application root.this.hotflag to loader context when HMR is enabledbuildMeta.harmonyhas been replaced withbuildMeta.exportsType: "namespacemap/foreachChunks/Modules/Parentsmethods are now deprecated/removedcreateGeneratorandgeneratorhooks for NormalModuleFactory to customize code generation