Skip to content
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

Using process.env variables in app.html #881

Open
iandevlin opened this issue Aug 16, 2023 · 4 comments
Open

Using process.env variables in app.html #881

iandevlin opened this issue Aug 16, 2023 · 4 comments

Comments

@iandevlin
Copy link

I have a Nuxt 2.17.1 project which uses an app.html file to define various things.

Within that app.html file it accesses variables like process.env.CDN_PATH to load such things as fonts from a CDN.

These appear to be completely inaccessible with Nuxt Bridge.

Can anyone tell me how to get these environment variables to work in this case?

And if it's not possible, first of all why, and secondly, what would be an alternative method? I cannot find anything at all in the documentation with regards to this.

Thanks in advance.

Copy link
Member

I'll have a look. would you provide a minimal reproduction?

@iandevlin
Copy link
Author

Unfortunately that's not possible at the moment, but the simple fact that you didn't reply with "oh no that won't work because of X" tells me that it should be possible to access process.env variables in a HTML file.

Copy link
Member

Well, honestly half the reason I asked was that it really doesn't seem like that should work.

@iandevlin
Copy link
Author

Ah ok, interesting, it works fine with Nuxt 2, but perhaps it's a webpack thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants