D
D
Denis Bukreev2017-04-16 14:38:08
webpack
Denis Bukreev, 2017-04-16 14:38:08

How to compile styles separately from JS in WebPack?

I looked at a bunch of tutorials on WebPack, and in all the authors sculpt styles in JS - what kind of nonsense?
How can I compile styles into a separate file that I can include in HTML?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-04-16
@denisbookreev

extract-text-plugin

{
        test: /\.css$/,
        loader: ExtractTextPlugin.extract({
          fallbackLoader: 'style-loader',
          loader: ['css-loader', 'postcss-loader'],
          publicPath: '/public',
        }),
      }, {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract({
          fallbackLoader: 'style-loader',
          loader: ['css-loader', 'postcss-loader', 'sass-loader'],
          publicPath: '/public',
        }),
      },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question