0๐
โ
I ended up writing my own Webpack plugin. This plugin will:
- Activate before any other plugin
- Gather Vue environment variables (
provcess.env.VUE_APP_*
) - Merge together all the files + environment variables needed by the service worker (instead of using
ImportScripts
). Mangling the files separately wont work, hence this step. - Run Terser on the merged file.
- Copy the result to the public folder so it picked up by Webpack normal build process.
I will push the code here once it is cleaned-upโฆ.
Source:stackexchange.com