webpack plugin
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 265
- PR merge metrics
- No merged PRs in 30d
Description
I played around a little with creating a webpack plugin:
``` javascript
class KssPlugin {
constructor (options) {
this.options = options
}
apply (compiler) {
compiler.plugin('compile', (params) => {
kss(this.options)
})
}
}
// webpack.config.js
module.exports = {
// other options
plugins: [
new KssPlugin({
// kss config
})
]
}
```
The stylesheet is successfully created in the default `stylesheet` directory. However, it would be nice to not actually write the files to disk, but use `compiler.plugin('emit')` instead to let webpack handle creating the files (or just keep them in memory while using webpack-dev-server).
How would I do that with the current API? Should I create a separate `kss-webpack-plugin` package or would you accept pull requests to support this within `kss`?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the webpack.config.js example and webpack's compiler.plugin('emit') entry point, then inspect how KSS currently writes generated files to the default stylesheet directory. Done means the requested webpack integration is clearly scoped, including whether it belongs in kss-node or a separate kss-webpack-plugin package, and generated stylesheets can be handled by webpack or kept in memory for webpack-dev-server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100