Skip to content

Firebase messaging service worker file #10695

Answered by slorber
jcubic asked this question in Q&A
Discussion options

You must be logged in to vote

Yes it's comppiled in a postBuild plugin lifecycle hook. Note you don't necessarily have to do this. In our case we do this because we use modern syntax in it, but you can also write syntax that works directly in browsers without having to downgrade syntax.

Compilation is not mandatory, and if you do compile, you can do it with the tools of your choice (not even necessarily webpack/Rspack like us)

But here's our pwa plugin code reusing our compilation infrastructure

    async postBuild(props) {
      const swSourceFileTest = /\.m?js$/;

      const ProgressBarPlugin = await getProgressBarPlugin({
        currentBundler: props.currentBundler,
      });

      const swWebpackConfig: Configu…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jcubic
Comment options

@slorber
Comment options

slorber Nov 19, 2024
Collaborator

Answer selected by jcubic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants