angular2-install

/**
 * 从github上下载angular2项目
 * npm install国内有可能出错,我反正报错了。改为cnpm install
 * 安装依赖
 */
git clone https://github.com/angular/quickstart.git quickstart
cd quickstart
npm install

npm install //ERR

npm ERR! sha1-/viqIjkh97QLu71MPtQwL2/QqBM= integrity checksum failed when using sha1: wanted sha1-/viqIjkh97QLu71MPtQwL2/QqBM= 
but got sha1-QC6Yy3j8txJhU5Qkszs8/6/o6Is=. (474949 bytes)

Windows删除不必要的文件

for /f %i in (non-essential-files.txt) do del %i /F /S /Q
rd .git /s /q
rd e2e /s /q

最后本地启动anular2工程

npm start

quickstart/.editorconfig详解

/**
 * EditorConfig帮助开发人员在不同的编辑器和IDE之间定义和维护一致的编码风格。
 * *  匹配除/之外的任意字符串 [*]表示所有
 * ** 匹配任意字符串
 * ?  匹配任意单个字符
 * [name]  匹配name字符
 * [!name] 匹配非name字符
 * {s1,s2,s3} 匹配任意给定的字符串(since 0.11.0)
 * @param root: 表明是最顶层的配置文件,发现设为true时,才会停止查找.editorconfig文件。
 * @param indent_style: 设置缩进风格,tab或者空格。tab是hard tabs,space为soft tabs(4个space)。
 * @param indent_size: 缩进的宽度,即列数,整数。如果indent_style为tab,则此属性默认为tab_width。
 * @param tab_width: 设置tab的列数。默认是indent_size。
 * @param end_of_line: 换行符,lf、cr和crlf
 * @param charset: 编码,latin1、utf-8、utf-8-bom、utf-16be和utf-16le,不建议使用utf-8-bom。
 * @param trim_trailing_whitespace: 设为true表示会除去换行行首的任意空白字符。
 * @param insert_final_newline: 设为true表明使文件以一个空白行结尾
 */
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true


[*.md]
max_line_length = 0
trim_trailing_whitespace = false

# Indentation override
#[lib/**.js]
#[{package.json,.travis.yml}]
#[**/**.js]

quickstart/bs-config.json 指定工程启动的根目录,例如这里是src

{
  "server": {
    "baseDir": "src",
    "routes": {
      "/node_modules": "node_modules"
    }
  }
}

https://segmentfault.com/a/1190000008563619