Skip to content

Webpack not watching import css files #543

@SplicePHP

Description

@SplicePHP

If I use the following syntax in a scss file webpack watch does not watch for changes in the imported file:

@import 'style.css';

Editing imported scss files does trigger webpack to recompile. Just not css.

My webpack config looks something like this:

                   {
                        test: /\.css$/,
//                        loader: cssLoaders.join('!')
                        use: [
                            "style-loader",
                            "css-loader",
                            {
                                loader: 'postcss-loader',
                                options: {
                                    plugins: function () {
                                        return [
                                            require('precss'),
                                            require('autoprefixer')
                                        ];
                                    }
                                }
                            }
                        ]
                    }, {
                        test: /\.scss$/,
//                        loader: scssLoaders.join('!'),
                        use: [
                            "style-loader",
                            "css-loader",
                            {
                                loader: 'postcss-loader',
                                options: {
                                    plugins: function () {
                                        return [
                                            require('precss'),
                                            require('autoprefixer')
                                        ];
                                    }
                                }
                            },
                            'sass-loader?outputStyle=expanded&includePaths[]=' + path.resolve(__dirname, "./node_modules/compass-sass-mixins/lib")
                        ]
                    }, 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions