There are new versions of webpack available from npm.
mode
or --mode
) between two modes now: production or developmentoptimization.*
(build your custom mode)process.env.NODE_ENV
are set to production or development (only in built code, not in config)none
mode 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)CommonsChunkPlugin
was removed -> optimization.splitChunks
, optimization.runtimeChunk
type: "javascript/auto"
when transforming JSON via loader to JSjavascript/esm
handles ESM more strictly compared to javascript/auto
:default
import, everything else (including namespace import) emit errors.mjs
modules are javascript/esm
by defaultimport()
sideEffects: false
is now supported in package.jsonsideEffects
in package.json also supports glob expressions and arrays of glob expressionsoptimization.splitChunks
option was introducedimport()
occur in a dead branchwebpackInclude
and webpackExclude
are supported by the magic comment for import()
. They allow to filter files when using a dynamic expression.System.import()
now emits a warningRule.parser.system: true
System.import
with Rule.parser.system: false
module.rules[].resolve
. It's merged with the global configuration.optimization.minimize
has been added to switch minimizing on/offoptimization.minimizer
has been added to configurate minimizers and optionswebpack-cli
to use the CLI--progress
) now displays plugin namesmodule.rules[].type
options.dependencies
configurations now throw errorsideEffects
can be overriden via module.rulesoutput.hashFunction
can now be a Constructor to a custom hash functionoutput.globalObject
config option to allow to choose the global object reference in runtime exitCodetype
and request
.include
test
and exclude
to the eval source map devtool pluginfor of
instead of forEach
Map
and Set
instead of Objectsincludes
instead of indexOf
text/javascript
and async
as this are the default values (saves a few bytes)__webpack_require__
and argument is omitted.wasm
, .mjs
, .js
and .json
extensions in this orderoutput.pathinfo
is now on by default in develoment modeentry
defaults to ./src
output.path
defaults to ./dist
production
defaults when omiting the mode
option<{parents}>
>{children}<
and ={siblings}=
in StatsbuildAt
time to statsimport()
now emits a error instead of a warningdone
is now an async hook*/
output.chunkCallbackName
to the schema to allow configurating WebWorker templatemodule.id/loaded
now correctly bails out of Module Concatentation (Scope Hoisting)Watching.invalidate
-!
behavior with post loadersrun
and watchRun
hooks for MultiCompiler
this
is now undefined in ESMvar
, const
or let
javascript/dynamic
or javascript/module
is used.buildMeta
of nulloriginal-fs
module for electron targetsplugins
plugin
calls with tap
calls (new plugin system)buildMeta.exportsType: "default"
for json modulesneo-async
instead of async
module.loaders
loaderContext.options
Compilation.notCacheable
flagNoErrorsPlugin
Dependency.isEqualResource
NewWatchingPlugin
CommonsChunkPlugin
plugin
method is backward-compatibleCompiler.hooks.xxx.tap(<plugin name>, fn)
nowChunk.chunks/parents/blocks
are no longer Arrays. A Set is used internally and there are methods to access it.Parser.scope.renames
and Parser.scope.definitions
are no longer Objects/Arrays, but Map/Sets.StackedSetMap
(LevelDB-like datastructure) instead of ArraysCompiler.options
is no longer set while applying pluginsDependency.getReference()
may now return a weak
property. Dependency.weak
is now used by the Dependency
base class and returned in the base impl of getReference()
Module
sContextModule
and resolveDependencies
Compiler.resolvers
into Compiler.resolverFactory
accessible with pluginsDependency.isEqualResource
has been replaced with Dependency.getResourceIdentifier
Template
are now staticoutputOptions
and requestShortener
has been moved to this classModule.meta
has been replaced with Module.buildMeta
Module.buildInfo
and Module.factoryMeta
have been addedModule
have been moved into the new objectsloaderContext.rootContext
which points to the context
options. Loaders may use it to make stuff relative to the application root.this.hot
flag to loader context when HMR is enabledbuildMeta.harmony
has been replaced with buildMeta.exportsType: "namespace
map/foreach
Chunks/Modules/Parents
methods are now deprecated/removedcreateGenerator
and generator
hooks for NormalModuleFactory to customize code generationI'm getting the following when trying to run Storybook in a project using Webpack 4;
node_modules/webpack/lib/DefinePlugin.js:42
compiler.hooks.compilation.tap(
^
TypeError: Cannot read property 'compilation' of undefined
at DefinePlugin.apply (/Users/thomasfoyster/Documents/Work/ctm-components/node_modules/webpack/lib/DefinePlugin.js:42:18)
Is this going to be resolved soon?
Yes, but it will be a breaking change
https://github.com/storybooks/storybook/pull/3148
I'd say it should be out in a week, but @shilman may correct me
What do you mean by strong?
I'm also getting the same error as @TomFoyster . Any idea on when this will be resolved? It's bizarre because my co workers haven't had this issue, they're both on win and mac. I'm on Windows as well.
Released as v4.0.0-alpha.0
Most helpful comment
Released as
v4.0.0-alpha.0