title: Register a service worker in the webpack
body: <p>I use webpack to build my React app. I can not understand how to point the way to my service worker. In the <code>index.js</code> file, I successfully receive a registration message, but I cannot access the file of the service worker in <code>public/serviceWorker.js</code></p>
  
  <p>WebPack config </p>
  
  <pre><code> plugins: [
      new HtmlWebpackPlugin({
          filename: 'index.html',
          template: 'public/index.html',
          favicon: 'public/favicon.ico'
      }),
      new MiniCssExtractPlugin({
          filename: 'style.css'
      }),
      new WorkboxPlugin.GenerateSW({
          swDest: path.join(__dirname, 'build/serviceWorker.js'),
          clientsClaim: true,
          skipWaiting: true
      })
  ],
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>  if ('serviceWorker' in navigator) {
      window.addEventListener('load', () =&gt; {
          navigator.serviceWorker.register('serviceWorker.js')
              .then((registration) =&gt; {
                  registration.pushManager.subscribe({
                      userVisibleOnly: true,
                      applicationServerKey: convertedVapidKey
                  })
                      .then((subscription) =&gt; {
                          sendSubscriptionToServer(subscription)
                      })
                      .catch((error) =&gt; {
                          console.log(error)
                      })
              })
              .catch((error) =&gt; {
                  console.log(error);
              })
      })
  }
  </code></pre>