-
Notifications
You must be signed in to change notification settings - Fork 71
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
Usage with Vite? #107
Comments
@alexgleason I was able to get import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
react({
babel: {
plugins: ['preval'],
},
})
],
}); |
Can you show any example of how you use this? @lobaak |
@lobaak Hey! Why did you specify |
@ArturBaybulatov sorry, that is a typo. I've corrected. @istonejoeljonsson we use the following to get the version of the library package const version =
preval`module.exports = process.env.npm_package_version` || '-'; |
Hello, I believe you can use vite's virtual module feature for this: See here for more info: https://evomark.co.uk/development/making-your-tailwind-config-available-to-your-entire-application-with-vite/ |
I'm migrating a legacy React TypeScript project from Webpack to Vite. I have some pretty substantial preval code.
Vite uses Babel internally, so I think it should be possible to use this with Vite. Has anyone succeeded in getting it working?
The text was updated successfully, but these errors were encountered: