Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SASS loader #12

Open
vvardges opened this issue Nov 6, 2017 · 0 comments
Open

Implement SASS loader #12

vvardges opened this issue Nov 6, 2017 · 0 comments

Comments

@vvardges
Copy link

vvardges commented Nov 6, 2017

Install and use the required loaders:

npm install sass-loader node-sass webpack --save-dev
npm i -D postcss-loader
npm install postcss-cli autoprefixer
npm install postcss-cli precss

With minimal setup, your webpack config should include this rule or similar:

 ...
  {
    test: /\.(scss)$/,
    use: [{
      loader: 'style-loader', // inject CSS to page
    }, {
      loader: 'css-loader', // translates CSS into CommonJS modules
    }, {
      loader: 'postcss-loader', // Run post css actions
      options: {
        plugins: function () { // post css plugins, can be exported to postcss.config.js
          return [
            require('precss'),
            require('autoprefixer')
          ];
        }
      }
    }, {
      loader: 'sass-loader' // compiles SASS to CSS
    }]
  },
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant