Skip to content

Instantly share code, notes, and snippets.

@changtimwu
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save changtimwu/4f09de4dfaacced20a87 to your computer and use it in GitHub Desktop.

Select an option

Save changtimwu/4f09de4dfaacced20a87 to your computer and use it in GitHub Desktop.
angular es6
  • use a recent version of nodejs ex. v0.12.2
  • install necessary modules
npm install -g npm
npm install -g coffee-script 
npm install -g jade babel jade-babel
npm install -g gulp
npm install -g yo jspm
npm install -g generator-systemjs 
mkdir myapp && cd myapp
yo systemjs
gulp run
http://localhost:9000
@changtimwu
Copy link
Author

成本

-rw-r--r--@ 1 timwu  staff   129K  7  1 09:54 js/browser-polyfill.js
-rw-r--r--@ 1 timwu  staff    83K  7  1 09:54 js/browser-polyfill.min.js
-rw-r--r--@ 1 timwu  staff   2.0M  7  1 09:54 js/browser.js
-rw-r--r--@ 1 timwu  staff   1.3M  7  1 09:54 js/browser.min.js
-rw-r--r--@ 1 timwu  staff   1.2M  7  1 18:46 js/traceur.js

@changtimwu
Copy link
Author

es6-module-loader transpiler 選babel不會動, 選 traceur 可動

但是 systemjs transpiler 選 babel 會動

System.config({
  "baseURL": ".",
  "transpiler": "babel",
  "babelOptions": {
    "optional": [
      "runtime"
    ]
  },
  "paths": {
    "*": "*.js",
    "github:*": "../jspm_packages/github/*.js",
    "npm:*": "../jspm_packages/npm/*.js"
  },
  "buildCSS": true,
  "separateCSS": false
});

@changtimwu
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment