Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build process gets stuck when this plugin is used #121

Open
joepagan opened this issue Jul 30, 2020 · 0 comments
Open

Build process gets stuck when this plugin is used #121

joepagan opened this issue Jul 30, 2020 · 0 comments
Labels

Comments

@joepagan
Copy link

joepagan commented Jul 30, 2020

Not sure why & how this is occurring, but, when this plugin is used in my setup my build process hangs & never completes initially.

Strangely, I can force the build process to complete when I save a "watched" scss or js file at a location not specified as one of the sass-resources-loader paths.

I have setup a custom plugin in my webpack commons config file logging the hooks afterEmit, done and failed:

compiler.hooks.done.tap('SpringPlugin', (stats) => {
          // console.log(stats);
          console.log('done');
        });
        compiler.hooks.failed.tap('SpringPlugin', (err) => {
          console.error(err);
        });
        compiler.hooks.afterEmit.tap('SpringPlugin', (compilation) => {
          console.log('afterEmit');
        });

When I save one of the files at my sass-resources-loader resources locations, i can see the logs for both the done & afterEmit hooks over and over again but the process cannot continue further after that.

Removing the sass-resources-loader plugin makes my build successful (minus the missing sass variables errors)

Here is my config for the plugin:

{
        test: /\.s?css$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader,
            options: {
              // only enable hot in development
              hmr: process.env.NODE_ENV !== 'production',
              // if hmr does not work, this is a forceful method.
              reloadAll: true,
            },
          },
          'css-loader',
          'postcss-loader',
          'sass-loader',
          {
            loader: 'sass-resources-loader',
            options: {
              resources: [
                `${path.resolve(__dirname, paths.src.scss)}/settings/**/*.scss`,
                `${path.resolve(__dirname, paths.src.scss)}/functions/**/*.scss`,
                `${path.resolve(__dirname, paths.src.scss)}/mixins/**/*.scss`,
              ],
            },
          },
        ],
      },

Do you have any suggestions on how this can be resolved?

Thanks for your work

Update:
It looks like this is also causing issues with stylelint, where I update one of the files as a sass-resources-loader path, it detects an error with npm start, but, when I update & fix the lint error, the errors do not go away, it's like this plugin is hijacking these files from being watched.

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

No branches or pull requests

2 participants