Answer the question
In order to leave comments, you need to log in
How to add sass to webpack + react?
Good afternoon!
How to properly add sass to webpack + react config?
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, './');
var APP_DIR = path.resolve(__dirname, 'src/');
var config = {
entry: APP_DIR + '/index.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
devServer: {
contentBase: BUILD_DIR
},
module: {
loaders: [
{
test: /\.jsx?/,
include: APP_DIR,
loader: 'babel-loader'
}
]
}
};
module.exports = config;
ERROR in ./src/index.jsx
Module parse failed: C:\Users\steko\Desktop\TEST\m-react\src\index.jsx Unexpected token (9:8)
You may need an appropriate loader to handle this file type.
| render() {
| return (
|
| Hello React Project!!!
|
Answer the question
In order to leave comments, you need to log in
Use sass-loader . The repository has installation instructions. If you want to use CSS modules, read the instructions for css-loader
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question