I can't figure out how to render a css file with the webpack sass-loader.
Here's what my webpackconfig.js looks like:
module.exports = {
context: __dirname + "/app",
entry: {
javascript: "./app.js",
html: "./index.html"
},
output: {
filename: "app.js",
path: __dirname + "/dist"
},
module: {
loaders: [
//JAVASCRIPT
{
test: /.js$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
},
//Index HMTML
{
test: /.html$/,
loader: "file?name=[name].[ext]",
},
//Hotloader
{
test: /.js$/,
exclude: /node_modules/,
loaders: ["react-hot", "babel-loader"],
},
// SASS
{
test: /.scss$/,
loader: 'style!css!sass'
}
],
}
}
As you can see I'm using the sass-loader module loader specified in the documentation.
{
test: /.scss$/,
loader: 'style!css!sass'
}
My root looks as such:
Project Root:
app:
style.scss
dist:
?????? WTF is my css file??
webpack.config.js
I can get everything else working such as html and jsx babble loaders.
I just type in webpack into the command line and things happen.
I'm doing something wrong with the sass loader.
What is it?
Please help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…