-
Notifications
You must be signed in to change notification settings - Fork 213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, let me say that this is sooooo what I've been wanting. This is exactly the direction this middleware needs to go.
My only concern is making sure we have appropriate docs for this. Otherwise, this is great! 😍
packages/style-loader/index.js
Outdated
neutrino.config.module | ||
.rule(options.ruleId) | ||
const styleRule = neutrino.config.module.rule(options.ruleId); | ||
const loaders = [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's mess with the formatting a little here:
const loaders = [
{
...
},
{
...
},
...options.loaders
]
.map(() => {
...
});
const obj = typeof loader === 'object' ? loader : { loader }; | ||
|
||
return Object.assign(obj, { | ||
useId: obj.useId || `${options.cssUseId}-${index}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, but this will need to be clearly noted in the documentation, that without the useId
, it will generate an id in this format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already have the docs written in #574.
This adds a
loaders
option tostyle-loader
, in which users may pass their own custom css loaders (postcss, sass, etc)Why?
extract-text
, css modules, hot-reloading, and css-loader'simportLoaders
option.style
rule (e.g. https://github.com/barraponto/neutrino-middleware-postcss, https://github.com/kopacki/neutrino-dev/blob/master/packages/neutrino-preset-sass/src/index.js)Example usage
importLoaders
has been set properly, taking into account the # loaders your have, andoptions.modules
.Related: #20