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

Running in webpack watch mode doesn't work after a recompile. #141

Closed
wesselvdv opened this issue Jul 6, 2021 · 4 comments
Closed

Running in webpack watch mode doesn't work after a recompile. #141

wesselvdv opened this issue Jul 6, 2021 · 4 comments

Comments

@wesselvdv
Copy link

Running in webpack watch mode doesn't work after a recompile, this results in the __webpack_require__.ab being scrubbed from the output.js

@wesselvdv
Copy link
Author

This is my bad. RTFM.

@MynockSpit
Copy link

@wesselvdv -- Which memo? I can't see anything referring to watch mode. Maybe I'm just blind!

@wesselvdv
Copy link
Author

wesselvdv commented Nov 26, 2021

@MynockSpit It's not referring to a watch mode, but to the cache mechanism introduced in webpack 5. You have to put the following in the plugins array in your config:

    plugins: [
      {
        apply(compiler: any) {
          compiler.hooks.compilation.tap(
            'webpack-asset-relocator-loader',
            (compilation: any) => {
              relocateLoader.initAssetCache(compilation, '');
            },
          );
        },
      },
    ]

Took me two days to figure out, so here's to 6 minutes for you.

@MynockSpit
Copy link

Awesome, thank you!

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

No branches or pull requests

2 participants