Skip to content

feat: add ability to output bundles in separate directory#4841

Closed
ValeryVS wants to merge 1 commit into
angular:masterfrom
ValeryVS:feat/bundles-output-dir
Closed

feat: add ability to output bundles in separate directory#4841
ValeryVS wants to merge 1 commit into
angular:masterfrom
ValeryVS:feat/bundles-output-dir

Conversation

@ValeryVS

Copy link
Copy Markdown
Contributor

Implements #4788

Add bundlesOutDir option to .angular-cli.json

.
..
bundles/
    main.bundle.js
index.html

@ValeryVS ValeryVS force-pushed the feat/bundles-output-dir branch 2 times, most recently from 86e2538 to 374c210 Compare February 20, 2017 09:30
@ValeryVS

Copy link
Copy Markdown
Contributor Author

There are errors with deploy test.
Can I run only my test with some command?
Manual testing is fine.

@ValeryVS ValeryVS force-pushed the feat/bundles-output-dir branch from 374c210 to ac7d692 Compare February 20, 2017 13:59
@ValeryVS ValeryVS force-pushed the feat/bundles-output-dir branch from ac7d692 to 83854a2 Compare February 20, 2017 14:39
@ValeryVS

Copy link
Copy Markdown
Contributor Author

@filipesilva could you see this css-urls fail? It is from #4803
It seems, that EOT files really should named with hash.

@filipesilva

Copy link
Copy Markdown
Contributor

Heya @ValeryVS, I'm not sure we want to add this option... It's very similar to the existing --deploy-url and I'm not sure how they should interact together. In fact, that's why the css-urls test is failing.

I think you raise a good point about EOT files. You can do it currently via ng build --output-hashing=media, but now that more stuff is being extracted then we should default to it.

@ValeryVS

Copy link
Copy Markdown
Contributor Author

I will research about deployUrl options more, and, may be, recreate this PR later.

@ValeryVS ValeryVS closed this Feb 28, 2017
@ValeryVS

ValeryVS commented Feb 28, 2017

Copy link
Copy Markdown
Contributor Author

I see...
For same purpose, I can use "deployUrl" setting, and, then, move bundle files with assets dir into "bundles/" dir.

@zakhenry

zakhenry commented Mar 7, 2017

Copy link
Copy Markdown

@ValeryVS how were you able to use deployUrl with moving the bundle files? I'm attempting to achieve this with

mkdir dist/static && find dist -type f -maxdepth 1 -mindepth 1 -not -name index.html -exec mv '{}' dist/static \;

which seems to mostly work, however some of the links are broken as I have a separate asset directory, but setting the deployUrl to static causes the path /static to be prepended to those asset urls

@ValeryVS

ValeryVS commented Mar 10, 2017

Copy link
Copy Markdown
Contributor Author

@zakhenry

.angular-cli.sjon

{
  "deployUrl": "app/"
}

makefile or shell script

mv dist dist-tmp
mkdir dist
mv dist-tmp dist/app
mv dist/app/index.html dist/

Result

./
    dist/
        app/
            assets/
                img.png
            main.bundle.js
        index.html
    src/

@zakhenry

zakhenry commented Mar 10, 2017

Copy link
Copy Markdown

@ValeryVS thanks, I was able to work it out, turns out I was having issue with the base root definitions in my scss files, eg I had to change url(/assets/path/to/file) to url(~assets/path/to/file so the webpack asset flattening still worked.

Saying that, I still think this should be an Angular CLI feature, as it is probably a very common use case to have your webserver redirect all requests to index.html unless it is matched under some directory

@ValeryVS

Copy link
Copy Markdown
Contributor Author

@zakhenry
Thanks for hint with tilda.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants