workbox
workbox copied to clipboard
Unable to use workbox-webpack-plugin with angular
Welcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with [workbox]
: https://stackoverflow.com/questions/ask?tags=workbox
Library Affected: workbox-webpack-plugin
Browser & Platform: all browsers
Issue or Feature Request Description: I am trying to use workbox-webpack-plugin with angular, but since my code uses typescript, it conflicts with angular ivy compiler.
I created an issue in the angular side, but they won't investigate it: https://github.com/angular/angular/issues/48589 Could anyone here help please.
Reproduction https://github.com/yelhouti/angular-workbox
EDIT: I modified the file form the github repo, by adding this before the merge:
new WorkboxPlugin.InjectManifest({
swSrc: './src/main/serviceworker/serviceworker.ts',
swDest: 'serviceworker.js',
compileSrc: true,
webpackCompilationPlugins: [
new AngularWebpackPlugin({
tsconfig: './tsconfig.serviceworker.json',
}),
]
})
);
config.entry['serviceworker'] = {
import: './src/main/serviceworker/serviceworker.ts',
runtime: false
}
but, not I have two servicworker files: one generated by angular serviceworker.[hash].js
and one by this plugin serviceworker.js
any idea how I can get rid of the first one ?
This is for an NX workspace though, but the same principles would apply: https://stackoverflow.com/questions/77111579/adding-workbox-to-an-angular-app-in-an-nx-workspace
Hope this helps.
Hi there,
Workbox is moving to a new engineering team within Google. As part of this move, we're declaring a partial bug bankruptcy to allow the new team to start fresh. We realize this isn't optimal, but realistically, this is the only way we see it working. For transparency, here're the criteria we applied:
- For PRs, we closed everything that doesn't target the current
v7
branch. - For Issues, we closed everything that was created before 2024.
Thanks, and we hope for your understanding! The Workbox team