Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Not working with css as an entry point & webpack 4 #50

Closed
sapkra opened this issue Aug 13, 2018 · 4 comments · Fixed by #51
Closed

Not working with css as an entry point & webpack 4 #50

sapkra opened this issue Aug 13, 2018 · 4 comments · Fixed by #51

Comments

@sapkra
Copy link

sapkra commented Aug 13, 2018

The page fully reloads when I'm changing the scss file and I get the following warning.

[HMR] Cannot apply update. Need to do a full reload!
[HMR] Error: Aborted because ./sass/style.scss is not accepted
Update propagation: ./sass/style.scss -> 5
    at hotApply (http://localhost:5000/webpack/css/style.js:526:30)
    at http://localhost:5000/webpack/css/style.js:364:22

Here the relevant parts from my webpack config:

entry: {
        'css/style': './sass/style.scss',
},
plugins: [
        new MiniCssExtractPlugin({
            filename: '[name].css',
            allChunks: true,
        }),
],
module: {
        rules: [
            {
                test: /\.scss$/,
                include: [
                    path.resolve(paths.sources.sass),
                ],
                use: [
                    'css-hot-loader',
                    MiniCssExtractPlugin.loader,
                    {
                        loader: 'css-loader',
                        options: {
                            url: false,
                            sourceMap: true
                        }
                    },
                    {
                        loader: 'sass-loader',
                        options: { sourceMap: true }
                    },
                ]
            },
        ]
}
@shepherdwind
Copy link
Owner

There are some in this repo https://github.com/shepherdwind/css-hot-loader/tree/master/examples . Can you provide me a tiny example code ? So I can reproduce your problem , the config you provide is just not easy for me to find out solution.

@sapkra
Copy link
Author

sapkra commented Aug 14, 2018

https://github.com/sapkra/css-hot-loader-test

Just enable "Preserve log" in your browser console and change the color of the headline in the style.scss

@shepherdwind
Copy link
Owner

Try latest version 1.4.2 . This problem fixed.

@sapkra
Copy link
Author

sapkra commented Aug 15, 2018

It's working now. Thanks a lot for your quick support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants