-
-
Notifications
You must be signed in to change notification settings - Fork 372
Closed
Labels
Description
I am switching to preact-cli from the preact boilerplate and I noticed that there is no webpack configuration file. The only missing feature for me is the ability to change the URL of my server: during development I am accessing localhost:3000 and during production api.my-server.com. With the preact boilerplate I use webpack's DefinePlugin:
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(ENV),
'API_HOST': (ENV === 'production') ? JSON.stringify('https://api.my-server.com') : JSON.stringify('http://localhost:3000')
}),(Here is the code as part of the entire project)
How do I achieve the same capability with preact-cli? I don't mind not using webpack at all. I know it can be done with grep and sed but that might not work on windows machines.
Thanks!