Closed KellsWorks closed 1 year ago
l found a work around with rollup.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
build: {
rollupOptions: {
input: {
app: './index.html',
'OneSignalSDKWorker': './OneSignalSDKWorker.js',
},
output: {
entryFileNames: assetInfo => {
return assetInfo.name === 'OneSignalSDKWorker' ? '[name].js' : 'assets/js/[name].js'
}
},
},
},
})
What happened?
I was setting up react-onesignal on my vite react app (https://documentation.onesignal.com/docs/react-js-setup). l perfectly configured everything with the worker, accessible at http://localhost:3000/OneSignalSDKWorker.js. The issue is on production. l can't access the OneSignalSDKWorker.js. Does this work only in development or ? Because l have tried like alot
Steps to reproduce?
What did you expect to happen?
l expect to find the OneSignalSDKWorker.js file after l deploy the app
Relevant log output
No response