V
V
ValeraNakhuy2019-04-10 03:07:36
webpack
ValeraNakhuy, 2019-04-10 03:07:36

How to add postcss.config.js to laravel.mix?

No matter how I tried, but the plugins are not picked up in any way
I tried to add the .postCss method, nothing
I tried to give the path to the config did not help either

mix.sourceMaps('source-map').react('resources/assets/js/app.js', 'public/js')
        .webpackConfig({
            module: {
                rules: [

                    {
                        test: /\.css$/,
                        loaders: [
                            { loader: 'style-loader' },
                            { loader: 'css-loader', options: { modules: true, importLoaders: 1, localIdentName: '[folder]_[name]__[local]--[hash:base64:5]' } },
                            { loader: 'postcss-loader',
                                options: {
                                    plugins: () => {
                                        postcssPresetEnv({
                                            stage: 3,
                                            features: {
                                                'browsers': browsers,
                                                'nesting-rules': true,
                                            }
                                        })
                                    }
                                }
                            }
                        ]
                    }
                ],

            }
        })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Spiridonov, 2019-07-23
@sir06Will

It is possible that it is no longer relevant, but I found this thing for myself: https://laravel-mix.com/extensions/postcss-config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question