I have a project setup where I use ExtractTextPlugin
to create a CSS file. I'm trying to create a dev Webpack config with the styles injected onto the page using style-loader
, css-loader
, and sass-loader
.
As far as I am aware the default behaviour is to inject the styles into a <style />
tag and I've removed all traces of ExtractTextPlugin
but it still doesn't want to inject the styles.
Does anybody know what might cause the styles to be lost? My Webpack config is below.
Config:
const webpack = require('webpack')
module.exports = config => Object.assign({}, {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: 'bundle.js.map'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
}, config)
Called with:
module.exports = require('../../dev')({
name: 'Onboarding',
entry: './src/apps/components/Onboarding/index.js'
})