-
-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
Problem
Using the options object (stylus: { ... }) in webpack2 fails. They validate the config with a schema now.
Invalid configuration object.
Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'stylus'....
Fix
Loaders should be updated to allow passing options via loader options in module.rules.
and/or
allow strings passed to use. Like: stylus?use=nib
Workaround 1
My workaround was to use the loader-string to inject options: stylus-loader?' + JSON.stringify(stylusOpts)
This works nicely however i can't use "use" this way:
Module build failed: Error: Plugin should be a function
Workaround 2
Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
plugins: {
new webpack.LoaderOptionsPlugin({
options: {
stylus: ...
}
})
dlindenkreuz, glebmachine, tobias-kuendig, ramasilveyra, icflorescu and 5 moreAhmed-Badawy
Metadata
Metadata
Assignees
Labels
No labels