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

webpackCompilationPlugins doesn't seem to work #2376

Closed
gabiseabra opened this issue Feb 19, 2020 · 2 comments · Fixed by #2400
Closed

webpackCompilationPlugins doesn't seem to work #2376

gabiseabra opened this issue Feb 19, 2020 · 2 comments · Fixed by #2400
Assignees
Labels
Bug An issue with our existing, production codebase. workbox-webpack-plugin

Comments

@gabiseabra
Copy link

Library Affected:
workbox-webpack-plugin@5.0.0

Browser & Platform:
all browsers

Issue or Feature Request Description:

webpackCompilationPlugins doesn't apply webpack.DefinePlugin and webpack.EnvironmentPlugin to the output bundle.

The following does not replace __REVISION__ in sw.js:

new InjectManifest({
  swSrc: './src/sw/index.js',
  swDest: 'sw.js',
  webpackCompilationPlugins: [
    new webpack.DefinePlugin({
      __REVISION__: JSON.stringify(process.env.COMMIT_SHA1)
    })
  ]
})
@jeffposnick jeffposnick self-assigned this Feb 25, 2020
@jeffposnick jeffposnick added Bug An issue with our existing, production codebase. workbox-webpack-plugin labels Feb 25, 2020
@jeffposnick
Copy link
Contributor

Thanks for reporting; I'll take a look.

@jeffposnick
Copy link
Contributor

Sorry that there's no progress to report; based on some local debugging, I can see that DefinePlugin does get added to the childCompilation that workbox-webpack-plugin creates, and I can see it being called during that compilation, but it doesn't appear to have the intended effect.

webpack/webpack#2978 and webpack/webpack#9240 seem related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An issue with our existing, production codebase. workbox-webpack-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants