small medium large xlarge

Generic-user-small
28 Nov 2016, 19:21
Widu Wittekindt (4 posts)

I wished there would be a short introduction in using sass/scss instead of css. Well yes, I found out by myself, its just a proposal.

in package.json:

{
  ...
  "dependencies": {
    ...
    "sass-loader": "^4.0.2",
    "node-sass": "^3.4.2",
   ...
  }
}

in webpack.config.js just add one more loader:

var config = {
  ...
  module: {
    loaders: [
      {
        test: /\.css$/,
        loader: 'style-loader!css-loader'
      },      
      {
        test: /\.sass$/,
        loaders: ["style", "css", "sass"]
      },
    ....
    ]
  }
}

in webpack/application.js

require ("application.sass");

and create webpack/application.sass

Dmfcb_pragsmall
28 Nov 2016, 19:30
David Copeland (476 posts)

The book doesn’t require writing any CSS, so I didn’t want to get into SASS, since you would not use it for anything in the book (and it’s one more thing to break with the JS community changes something :)

Generic-user-small
28 Nov 2016, 20:20
Widu Wittekindt (4 posts)

Haven’t gotten very far in the book - so i didn’t know that you won’t write a line of css - nice. Its just that I prefer sass so much over css, that while following the book I instantly wanted to replace it :)

You must be logged in to comment