PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

Build with watch mode #194

Open kuzyas opened 7 years ago

kuzyas commented 7 years ago

Is there a way to build project for development with watch parameter? Something like this: npm run build:dev --watch

fesor commented 7 years ago

Run npm start to starts browserify + webpack dev server, which provides you incremental builds of your application.

kuzyas commented 7 years ago

How can i specify output folder? For example in angular2-webpack-starter I can do this by running npm run watch @fesor

fesor commented 7 years ago

NG6-starter doesn't provide you any dev builds. It only have webpack-dev-server which stores all build results in memory.

If you want, you can add custom script which starts webpack using different config (other than webpack.dist.config.js).

fesor commented 7 years ago

@kuzyas Could you provide more info about your usecase? Why do you need dev builds (why not just use webpack-dev-server)

kuzyas commented 7 years ago

I have api on Sharepoint server, when I am making http request from http://localhost:3000 to http://spserver:80/api it returns 401 Unauthorized error.

fesor commented 7 years ago

@kuzyas so you have problems with CORS on sharepoint server?

What you could do, is to use browsersync proxy to eliminate preflight requests on sharepoint server. Could this help?

kuzyas commented 7 years ago

Thanks, I have solved CORS problem earlier with proxy. The real problem was with sharepoint authentication, which I've solved by changing server settings.

fesor commented 7 years ago

I leave this issue opened since there are real use cases when you can't change server settings. Will try to update webpack configs and run scripts asap.