Thanks, @rstoenescu.
I’ve got my service worker going using the copy-webpack-plugin
. I added this to my webpack.base.config.js
:
var CopyWebpackPlugin = require('copy-webpack-plugin')
and in the list of plugins near the bottom of that file:
new CopyWebpackPlugin([
{
from: 'root/'
}
])
Beside src
folder, I have a new folder that I called root
. All the files in that folder end up in the root of the dev
and build
outputs.
To use them, the index.html
file has:
and to get OneSignal going, add their code to themain.js
file
I’m actually using the OneSignal service worker along with my own. To do this, I edited both of the OneSignal files to add a reference to mine:
See https://documentation.onesignal.com/docs/web-push-sdk-setup-https for OneSignal information.