accurat / accurapp

Create JS apps with flexible build configuration, tailored for the specific needs of Accurat
MIT License
21 stars 5 forks source link

Add BUILD_PATH env variable to customise naming of production folder #75

Open lucafalasco opened 3 years ago

lucafalasco commented 3 years ago

Would be nice to change the path of the production folder, in my use case we have to create different folders at build time for each different language. Example:

build/
-- app.js
-- index.html
-- assets/
-- fr/
---- app.js
---- index.html
-- de/
---- app.js
---- index.html

BUILD_PATH=build/fr

https://github.com/accurat/accurapp/blob/7c87d0dcbe6ef0d4ce20fa1c249bbfa08523843e/packages/webpack-preset-accurapp/index.js#L300

lucafalasco commented 3 years ago

Also maybe this line should be reverted?

https://github.com/accurat/accurapp/commit/d432792da236091c337c63d289707e15f645c009#diff-9b7d14c4a3da62774803e2fe1499ba9cff536bfd18e4adf22a46b5e8012f4aa7L30-R29

It would work perfectly if reading the path from config.output.path

marcofugaro commented 3 years ago

Oops didn't realize that was an issue, I'll put back the config.output.path thing.

marcofugaro commented 3 years ago

Done.

lucafalasco commented 3 years ago

@marcofugaro nice, although I'm going to reopen this for the main issue which is supporting a BUILD_PATH env variable ok?

marcofugaro commented 3 years ago

Sure, is setting it from the webpack.config.js not enough?