Environment.json vs environment.ts

I have just installed latest aurelia-cli 1.1.0 and the environment files (dev.js, prod.js) are no longer in aurelia_project folder but in config folder and they are .json files rather than .ts. Is this inentional? From which version, I cannot find any mention of this in release notes. Thank you!

1 Like

Yes, v1.1 refactored webpack setup. Please upgrade to latest v1.1.1 for better compatibility with old commands.

If you look at run and build task files, they are merely alias to npm start and npm run build. Basically, webpack runs directly by webpack without aurelia-cli magic (or should I say trouble).

The package.json listed those scripts.

The env files are now handled by a webpack plugin app-settings-loader by @Sayan751, instead of handled by aurelia-cli gulp task previously.

We will update doc for this change. You can still use au run, but you can directly use npm start.

1 Like

correct. and the new way to import environment is

import * as environment from '../config/environment.json';

Thank you!

1 Like