K
K
kippusen2017-07-31 10:08:53
JavaScript
kippusen, 2017-07-31 10:08:53

How to move the webpack task to a separate command?

I have two options for processing sass in my webpack config:
working, the one on which I typeset is usually
commented out, when the customer requires a separate css file
Is it possible to do something so that I don’t have to edit the config every time, but let’s put it in a separate command, .e. By default, it fulfills the first option and compiles a separate file on command?

{
            test: /\.scss$/,
            use: [{
                loader: "style-loader"
            }, {
                loader: "postcss-loader"
            }, {
                loader: "sass-loader"
            }]
        },
        // {
        //  test: /\.scss$/,
        //  use: ExtractTextPlugin.extract({
        //      fallback: 'style-loader',
        //      use: ['postcss-loader', 'sass-loader']
        //  })
        // },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kippusen, 2017-07-31
@kippusen

There are two solutions:
1. Have two config files and run the one you need with the command
2. Write a config with conditions that are passed as arguments on the command line when calling webpack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question