angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

[Improvement] Add 'outputPath' option in builder "@angular-devkit/build-angular:dev-server" schema

Open jmesa-sistel opened this issue 8 years ago • 3 comments

Versions

Angular CLI: 6.0.1
Node: 8.11.1
OS: win32 x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@angular/cli                      6.0.1
@angular/pwa                      0.6.1
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Desired behavior

Add 'outputPath' option in builder "@angular-devkit/build-angular:dev-server" schema, so if this field is used the files will be written. So we can debug with devserver and at the same time check it in a tomcat or another backend.

Mention any other details that might be useful (optional)

I have been using 'write-file-webpack-plugin' ejecting the webpack configuration in previous versions.

jmesa-sistel avatar May 16 '18 10:05 jmesa-sistel

@jmesa-sistel thanks for open the issue. however we should be careful how we increase the scope of the CLI because each new feature means new code to maintain and fix issues in.

In this particular case, you can use https://github.com/manfredsteyer/ngx-build-plus to add addition plugins in the webpack pipeline.

Thanks

alan-agius4 avatar Feb 15 '19 12:02 alan-agius4

@alan-agius4 I already using that addition, also I fix the bug to be able to use write-file-webpack-plugin, but I think the only thing you have to do is set writeToDisk in devServer. Anyway maybe writeToDisk will be removed in webpack 5 because of this comments. I had to set:

output: {
        .....
        futureEmitAssets: false   
    },

to get it working (check pull request)

Edit: I'm jmesa, I forgot to change to my job account

rodries avatar Feb 15 '19 13:02 rodries

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.