Skip to content

ng build with absolute outputPath outputs index.html in wrong location #14474

Closed
@bgotink

Description

@bgotink

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, version 7 doesn't have this issue

Description

Running

ng build --outputPath /tmp/dist

outputs the assets in /tmp/dist while the index.html is written to ./tmp/dist.

🔬 Minimal Reproduction

$ cd /tmp
$ npx --package @angular/cli@8.0.0-rc.4 ng new foo --prefix foo
$ cd foo
$ yarn ng build --outputPath /tmp/foo-dist
$ ls 
README.md  angular.json  browserslist  e2e  karma.conf.js  node_modules  package.json  src  tmp  tsconfig.app.json  tsconfig.json  tsconfig.spec.json  tslint.json  yarn.lock
$ find tmp
tmp
tmp/foo-dist
tmp/foo-dist/index.html
$ find /tmp/foo-dist
/tmp/foo-dist
/tmp/foo-dist/main-es2015.js
/tmp/foo-dist/runtime-es2015.js
/tmp/foo-dist/vendor-es5.js
/tmp/foo-dist/favicon.ico
/tmp/foo-dist/styles-es2015.js.map
/tmp/foo-dist/vendor-es2015.js
/tmp/foo-dist/styles-es5.js.map
/tmp/foo-dist/runtime-es5.js
/tmp/foo-dist/styles-es2015.js
/tmp/foo-dist/polyfills-es2015.js.map
/tmp/foo-dist/main-es2015.js.map
/tmp/foo-dist/polyfills-es2015.js
/tmp/foo-dist/vendor-es2015.js.map
/tmp/foo-dist/styles-es5.js
/tmp/foo-dist/polyfills-es5.js.map
/tmp/foo-dist/polyfills-es5.js
/tmp/foo-dist/vendor-es5.js.map
/tmp/foo-dist/runtime-es5.js.map
/tmp/foo-dist/main-es5.js
/tmp/foo-dist/runtime-es2015.js.map
/tmp/foo-dist/main-es5.js.map

🔥 Exception or Error

Unable to serve the built app

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.0.0-rc.4
Node: 10.15.3
OS: darwin x64
Angular: 8.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0-rc.4
@angular-devkit/build-angular     0.800.0-rc.4
@angular-devkit/build-optimizer   0.800.0-rc.4
@angular-devkit/build-webpack     0.800.0-rc.4
@angular-devkit/core              8.0.0-rc.4
@angular-devkit/schematics        8.0.0-rc.4
@ngtools/webpack                  8.0.0-rc.4
@schematics/angular               8.0.0-rc.4
@schematics/update                0.800.0-rc.4
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0
    

Anything else relevant?

Verified on a UNIX system, I don't know if this issue exists on Windows.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions