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

Webpack #159

Open
raulghm opened this issue Mar 26, 2017 · 4 comments
Open

Webpack #159

raulghm opened this issue Mar 26, 2017 · 4 comments
Labels

Comments

@raulghm
Copy link

@raulghm raulghm commented Mar 26, 2017

What is the best way for work with webpack?

@simonsmith
Copy link
Member

@simonsmith simonsmith commented Mar 27, 2017

For now I'd recommend using the postcss-loader and add the plugins you need. So something like:

// postcss.loader.js
const atImport = require('postcss-import');
const customProperties = require('postcss-custom-properties');
const customMedia = require('postcss-custom-media');
const autoPrefixer = require('autoprefixer');

module.exports = {
  loader: 'postcss-loader',
  options: {
    plugins() {
      return [
        atImport,
        customProperties,
        customMedia,
        autoPrefixer,
      ];
    },
  },
};
// webpack.config.js
const postcssLoader = require('./postcss.loader');

module.exports = {
 /* ... other config options */
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader?importLoaders=1',
          postcssLoader,
        ],
      },
    ],
  },
});

We'll look into a more 'official' solution if it makes sense, otherwise I'll just get this documented. Let's leave this issue open until then

@shavidzet
Copy link

@shavidzet shavidzet commented Apr 7, 2017

I had same problem, I wanted to use suitcss preprocessor and utils as a webpack plugin, that's why I decide to develop following plugin https://github.com/ShavidzeT/suit-webpack-plugin

@simonsmith
Copy link
Member

@simonsmith simonsmith commented Apr 7, 2017

@shavidzet Nice. We certainly need a more concise solution.

I had actually started work on a webpack plugin for SUIT too. I'll add it to the org when I get a chance to finish it.

@simonsmith simonsmith transferred this issue from suitcss/preprocessor Feb 13, 2019
@mlnmln
Copy link
Contributor

@mlnmln mlnmln commented Mar 1, 2019

I would recommend just to document how to use SUIT with postcss loader.

Other than that, see #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.