slightlyfaulty / stylus-native-loader

✒️ A super fast Stylus loader for Webpack that leverages the built-in power of Stylus.
MIT License
15 stars 1 forks source link

`watchingDirs` and sourceMap enabled cause webpack 5 looping build #6

Open singggum3b opened 3 years ago

singggum3b commented 3 years ago

Hi ! As title stated, when watchingDirs and sourceMap are enable webpack 5 keep looping build when there're no changes

"webpack": "^5.23.0",
"stylus": "^0.54.8",
"stylus-native-loader": "^1.4.4",
{
                test: /\.(styl|css)$/i,
                use: [
                    // {
                    //     loader: "style-loader",
                    //     options: {
                    //         sourceMap: true,
                    //     }
                    // },
                    MiniCssExtractPlugin.loader,
                    {
                        loader: "css-loader", // translates CSS into CommonJS
                        options: {
                            modules: {
                                // auto: true,
                                localIdentName: isProduction ? "[hash:base64]" : "[path][name]__[local]--[hash:base64:5]",
                                // localIdentContext: path.resolve(__dirname, SRC_FOLDER),
                            },
                            importLoaders: 3
                        }
                    },
                    {
                        loader: "typed-css-modules-loader",
                    },
                    {
                        loader: "postcss-loader",
                    },
                    {
                        loader: "stylus-native-loader",
                        options: {
                            include: [
                                `./${SRC_FOLDER}`
                            ],
                        }
                    },
                ]
            },
slightlyfaulty commented 3 years ago

Sorry for the late reply, I somehow missed the notification for this issue 😅

I've tried to reproduce the issue on my side but I can't seem to get it to loop. Would it be possible for you to post your full webpack.config.js or set up a repro?

I'm also curious if this happens in watch mode or when just running a normal build?