aurelia / new

The Aurelia 2 scaffolding repo used by our tools to setup new projects.
MIT License
38 stars 18 forks source link

add .env for webpack and fix asset loading #66

Closed brandonseydel closed 3 years ago

3cp commented 3 years ago

Thx! Please resolve the conflicts so I can merge it.

3cp commented 2 years ago

I noted vue didn't use dotenv-webpack, they got a nice little internal implementation to handle .env files, directly built on top of dotenv and dotenv-expand.

https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/Service.js

https://cli.vuejs.org/guide/mode-and-env.html#environment-variables

It's quite flexible and convenient to use in my experience with Vue, you can have a base .env file, then per mode .env.development and env.production, and on top of that, a local only .env.development.local (not committed to git).

However they did not expose this feature into a standalone webpack plugin, which can be quite useful.

ivanbacher commented 2 years ago

Just created a default app

✔ Would you like to use the default setup or customize your choices? › Default ESNext Aurelia 2 App

and get this error:

Failed to load ./.env.undefined.

Shouldn't .env.development get loaded by default without having to change anything?

3cp commented 2 years ago

Thx, it was overlooked. Pls try again.

ivanbacher commented 2 years ago

No problem. Thanks for the fix.