Repository navigation
Proposal: Support default custom output path #817
Description
Problem:
Currently there is no official support for setting a default custom path. This can be important for those that have different project structures or use a different server to host angular2 such as asp.net core which expects static files to be in a folder called wwwroot/.
There is also not a consistent way to unofficially set a default value for custom output path. For ng buld and ng serve as they are still just the default commands in ember cli you can create a .ember-cli file with the following and it will work
{
"output-path": "wwwroot/"
}
However, for ng test it has the output folder hard-coded to dist/ and as it is, as an add-on command would not use .ember-cli
Proposal:
I was only able to find three commands that use an output-path flag, build, serve, test. The following are what I think would need to change or be completed to support this feature.
- General
-
Support output path in angular-cli.json as a sub property of defaults. Would probably be called outputPath to match the cli flag output-path and the format in angular-cli.json already. Would look something like:
{ "defaults": { "outputPath": "wwwroot/" } }_Required change:_ Update angular-cli.json schema
-
- Test command
-
Remove hard-coded output path and instead retrieve it from
_Required change:_ Use
this.project.ngConfigto get default settings and use it instead to constructbuildOptions -
Add output-path flag to be consistent with other commands.
_Required change:_ Add another option toavailableOptions
-
- Build Command
- Create a BuildCommand in addon/ng2/commands. This would be a wrapper of the ember cli build command but would read default settings from angular-cli.json
- Serve Command
- Create a ServeCommand in addon/ng2/commands. This would be a wrapper of the ember cli serve command but would read default settings from angular-cli.json
Note: As I have told @hansl I am willing to go through the design process and work on this.
Activity
JonCubed commentedon May 18, 2016
other use cases:
JonCubed commentedon Jun 6, 2016
@filipesilva @hansl what is the next step? Design docs or can I start working on this?
filipesilva commentedon Jun 7, 2016
@JonCubed you're most welcome to make a PR for this functionality, make sure to add tests that verify it works as well.
JonCubed commentedon Jun 9, 2016
@filipesilva sure no problems
filipesilva commentedon Oct 9, 2016
Implemented as
outDirinangular-cli.jsoncurrently. See #1109 (comment) also.rahul-winner commentedon Feb 8, 2017
Neither of option to create custom distribution folder is working for me. I tried following
nothing worked :(
Could anyone please help me out.
Thanks. Rahul
JonCubed commentedon Feb 9, 2017
@rahul-winner looking at build.ts
ng build --output-path customDistshould work. Alternatively if you want it to be a default and not have to use the--output-pathflag you can use--source-dirwithng neworng initcommandsangular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
chore(lint): require semicolons