These are chat archives for jdubray/sam

9th
Aug 2016
Jean-Jacques Dubray
@jdubray
Aug 09 2016 01:06
It looks like all these questions are still pretty much in flight for ng2. I found this on stackoverflow

OneTime Setup

  • npm install (run in cmd when direcory is projectFolder)
  • npm install -g angular-cli
  • ng init if it is an existing application
  • ng new if it is an new application

Bundling Steps

  • ng build --prod (run in cmd when direcory is projectFolder)

bundles are generated to projectFolder / dist /

Jean-Jacques Dubray
@jdubray
Aug 09 2016 03:46
Turns out this ng cli is a great and easy way to build a prod version of your angular2 app, this is the output of a pretty sizeable Angular2 app
blob
It's almost embarrassing to share my npm scripts, can't really said that I worked more than a few seconds on it compared to everything else I tried:
 {   
    "build": "npm run clean && ng build",
    "build:prod": "npm run clean && ng build -prod"  
}
@chiwoojo not sure if that's a full replacement to webpack, but even I can use the ng cli
Edward Mulraney
@edmulraney
Aug 09 2016 09:08
ng-cli looks good (with regard to bundling). Aurelia are going in a similar direction but they built easy-webpack to try and simplify things: http://blog.durandal.io/2016/07/12/release-candidate-update/
Fred Daoud
@foxdonut
Aug 09 2016 12:07
@jdubray to answer your previous question, I've also abandoned gulp/grunt in favour of npm scripts.
I'd say just npm scripts, since even with gulp or grunt, you need npm scripts to launch them..
Edward Mulraney
@edmulraney
Aug 09 2016 12:14
@foxdonut do you trigger webpack through your npm scripts?
Fred Daoud
@foxdonut
Aug 09 2016 12:20
@edmulraney yes
I also like that you can trigger webpack (and other tools) in an npm script without the full node_modules/... path and without need it to be installed -g globally
Edward Mulraney
@edmulraney
Aug 09 2016 12:28
Yeah I never rely on global install. You can guarantee local install because the user will run npm install on your project
so npm run test might run the test.sh script which looks like ./node_modules/.bin/ava --verbose for example
Fred Daoud
@foxdonut
Aug 09 2016 15:30
@edmulraney do you use ava for your tests?
Edward Mulraney
@edmulraney
Aug 09 2016 15:31
currently yes
previously mocha
what do you use?
devin ivy
@devinivy
Aug 09 2016 15:36
i'm a big fan of lab
Jean-Jacques Dubray
@jdubray
Aug 09 2016 15:56
For the record , ng build is not even documented yet https://cli.angular.io/
Edward Mulraney
@edmulraney
Aug 09 2016 16:05
@devinivy looks similar to mocha - does it have some advantages?
Jean-Jacques Dubray
@jdubray
Aug 09 2016 16:07
@edmulraney @foxdonut thank you for sharing that info, it's always great to get a pulse as to where things at/going
devin ivy
@devinivy
Aug 09 2016 17:12
@edmulraney i prefer it because it's lighter and has less feature bloat. and in my opinion the associated assertion library (code) is a bit more ergonomic and safer than chai. lab and code integrate with each other in some nice ways.
but yeah, it's comparable to mocha