-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[issue] Build for really old Browsers #309
Comments
I targeted es2016 with vite and tsconfig although I'm having a hard time confirming that its actually compiling to es2016 (and the errror persists) import { defineConfig } from 'vite'
import typescript from '@rollup/plugin-typescript'
import path from 'path'
export default defineConfig((configEnv) => ({
clearScreen: false,
build: {
target: "es2016", // CHANGE_1
sourcemap: false, // CHANGE_2
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: '@gveditor/web_components',
fileName: (format) => `index.${format}.js`
},
rollupOptions: {
external: ['react', 'styled-components'],
output: {
"format":"iife" // CHANGE_3
},
plugins: [
typescript({ tsconfig: './tsconfig.json' })
]
}
}
})); |
I am not sure yet, but, I think this might also happen on Linux, I still have to try it. |
Yeah I'm pretty sure the issue is that vite is still not converting to es2016. There are still <script type=module> tags which are a recent feature, and it's also keeping all the import statements. In the index.html I took the type=module away from the index.tsx and it produces a new error based on failing at the first import statement. I tried tracking down where the transpiled files were (more than just the ones inside web_components/dist). I copied some source stuff from the app window, and did a full recursive content search but nothing turned up which was really strange. So I have no idea where vite it storing the compiled version of main.tsx. |
I also tried tracking down how to properly target es2016 with vite, but documentation is quite parse on the subject. I can't find any open issues or examples either. I'm thinking of
But I haven't gotten around to either of those yet |
Update: I just tried on Linux and it seems to work fine on a new Fedora 36 |
on that system, If you do inspect element and look at the HTML, are there any scripts with module tags? |
To be honest, I think what really matters is making sure the release version actually works |
I'll see if I can do a full build next time I'm in the code. I've been working on a Tauri template repo (even before I found Gravitron) and I'm finding/solving a lot of system issues, which might be relevant to this. |
Inital Issue
Browser results
The text was updated successfully, but these errors were encountered: