DEV Community

loading...

Discussion on: Hide environment variables in your StencilJS project

Collapse
jericam profile image
Erica Marchi • Edited

Thank you for the tutorial :)
I didn't get one thing...

Inside config.dev.json and config.prod.json there are no devConfig/prodConfig.
Infact,
import devConfig from './config.dev.json';
import prodConfig from './config.prod.json';
gives me this error "Cannot find module 'config.dev.json'. / Cannot find module 'config.prod.json'. "

The code inside the two json files it's the same of the tutorial.

Collapse
daviddalbusco profile image
David Dal Busco Author

You are facing the error in your editor or when you run the command?

In my editor I had to add the following:

// @ts-ignore
import devConfig from './config.dev.json';
// @ts-ignore
import prodConfig from './config.prod.json';

but otherwise, do you have maybe a special tsconfig.json file which doesn't allow you to import from json files?

is your project open source, could I check it out?