import scss in js

Solutions on MaxInterview for import scss in js by the best coders in the world

showing results for - "import scss in js"
Zane
15 Mar 2018
1Firstly, sassLoader and postcss are not valid webpack config attributes https://webpack.js.org/configuration
2
3The way you would typically go about it is to add the .scss file to your entry
4
5  entry: {
6    app: './src/app.js',
7    styles: './pathtoyourstyles/style.scss'
8  },
9and then add the appropriate loaders.
10
11loaders: [
12  {
13    test: /\.scss$/,
14    loaders: ["style-loader", "css-loader", "sass-loader"]
15  }
16]