I'm working with workbox-sw
and workbox-webpack-plugin
My src sw.js
file at root folder (same level with my .env file)
How can I get env variables and accessing it into my src sw.js
file
This is from my webpack.config.js
new workboxPlugin({
globDirectory: 'dist',
globPatterns: ['**/*.{html,js,css,svg,otf,png,jpg,gif}'],
swSrc: './sw.js',
swDest: path.join('public', 'sw.js')
})
Every help will be appreciated! Thanks everyone!