2016-08-12 72 views

回答

0

我的版本npm和nodejs的問題似乎是包json中的大括號複製命令。

這是原單包JSON

"scripts": { 
    "postinstall": "typings install --ambient", 
    "clean": "rimraf built/", 
    "copy": "cp src/{index.html,styles.css,system-config.js} built/", 
    "copytemplates": "cp src/app/{*.html,*.css} built/app/", 
    "build": "tsc && npm run copy && npm run copytemplates", 
    "watch": "tsc --watch", 
    "serve": "http-server -p 9090 -c-1", 
    "test": "karma start karma.conf.js" 
} 

這是我的版本中,我取代了「複製多個文件一次」與個人複製命令的方法腳本的一部分。該版本正在工作。

"scripts": { 
    "postinstall": "typings install --ambient", 
    "clean": "rimraf built/", 
    "copy": "npm run copyIndex && npm run copyStyles && npm run copySystemConfig", 
    "copyIndex": "cp src/index.html built/", 
    "copySystemConfig": "cp src/system-config.js built/", 
    "copyStyles": "cp src/styles.css built/", 
    "copytemplates": "npm run copytemplatesHtml && npm run copytemplatesCSS", 
    "copytemplatesHtml": "cp src/app/*.html built/app/", 
    "copytemplatesCSS": "cp src/app/*.css built/app/ ", 
    "build": "tsc && npm run copy && npm run copytemplates", 
    "watch": "tsc --watch", 
    "serve": "http-server -p 9090 -c-1", 
    "test": "karma start karma.conf.js" 
}, 

這肯定不能這樣,但它是它似乎爲我工作的唯一途徑。

相關問題