Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to set outDir to "../www/" #2006

Closed
crebuh opened this issue Sep 7, 2016 · 10 comments · Fixed by #2158
Closed

Not able to set outDir to "../www/" #2006

crebuh opened this issue Sep 7, 2016 · 10 comments · Fixed by #2158
Assignees

Comments

@crebuh
Copy link

crebuh commented Sep 7, 2016

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Linux, Ubuntu 14.04.

  1. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.11-webpack.2
node: 4.4.4
os: linux x64

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

Update apps.outDir to "../www/" in angular.cli.json and execute ng build prod


As described above I'm trying to update the output directory when building the app. I have wrapped a cordova project around the ng2-application so it would be nice to build inside the www-folder (which worked before upgrading to webpack).

Now the build is always played into a dist folder. In addition the www-folder is always deleted, when I start ng build.

Any advice?

edit:

I found an entry in the .ember-cli-file called "output-path" and also set it to "../www/" without success ..

@crebuh crebuh changed the title Not able to set outDir to "../www" Not able to set outDir to "../www/" Sep 7, 2016
@ghost
Copy link

ghost commented Sep 8, 2016

Upgrade your node to 6.5+, your version is no longer supported.

Having the build output to folder above the project root is not ideal and should not be supported.

You can solve your issue with a copy or move command, or by using an npm script.

@crebuh
Copy link
Author

crebuh commented Sep 8, 2016

@robertbaker

thanks for you answer. I will solve it with a npm script in the meanwhile.

Why having the build output above the project root is not ideal?

@kylecordes
Copy link

@robertbaker I am also interested in thoughts on why this "should not be supported". In our projects we often have a client project parallel to a server project - server project might be another Node project or might be 0% JavaScript.

A fully flexible Outdir would make it easy for the client project to emit the bundled output into the server project's web asset directory. Lack that we use an extra NPM script (with a file copying utility), as you described. But it feels superflous, like it is papering over an arbitrary limitation.

@crebuh
Copy link
Author

crebuh commented Sep 15, 2016

What is also very interesting is the fact, that when I copy the dist folder manually one level higher to the root of my project and name it www (so that cordova recognizes the folder as a cordova project) this folder is deleted the next time I'm build the project.

@swaechter
Copy link

swaechter commented Sep 15, 2016

Same problem here: We embed an angular-cli in our Spring boot application:

Source: src/project/src/main/angular/
Current build path: src/project/src/main/angular/dist
Preferred build path: src/project/src/main/resources/public
Required static resources path for Spring Boot: src/project/src/main/resources/public

So, I am looking forward for such a feature. Of course you can copy the dist directory with npm, but what if you run ng in watch mode (One day)? Run another script that brute copies the dist directory every time it changes?

@swaechter
Copy link

@crebuh ng build -prod --output-path ../resources/public works for me. No .ember-cli file, outDir is "dist" (Dummy value) with 1.0.0-beta.11-webpack.9-4

@Meligy
Copy link
Contributor

Meligy commented Sep 22, 2016

Note: The specific outcome of this issue has changed as tested in recent versions (1.0.0-beta.15).

No ember related artifacts caused by it.

Also, as mostly mentioned in #2230:

  • ../folder, .folder, and folder all are the same
  • No notable outcome at all that shows anyone is looking at this config key
  • It's not OS specific, as it's the same on macOS and Windows
  • as mentioned here, ng build -o any-path-from-pre-point still works with all cases from 1st point

@AurelieV
Copy link

AurelieV commented Sep 25, 2016

Facing the issue, it seems that the bug is in ember-cli/conception

  • packages/angular-cli/models/webpack-build-common.ts => outDir has the correct value in appConfig, but it is overwritted by the options who always has the default value, even if none is provided

@solimanware
Copy link

solimanware commented Jul 29, 2017

I tried in .angular-cli.json
"outDir": "./../public", not working
But in terminal I used
ng build -op ./../public it's working

is it still a bug?

Edit

I just removed the ./ and it's working now properly ... I am using Mac too

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants