Angular 2 + Typescript compiler copy html and css files

后端 未结 7 1191
清酒与你
清酒与你 2020-12-05 07:01

In Angular2 I would have

\"outDir\": \"dist/app\"

in tsconfig.json. As a result the transpiled .js and .map files are generated in /di

7条回答
  •  没有蜡笔的小新
    2020-12-05 07:22

    From the Bernardo's answer I changed this

     "html": "find ./app -name '.html' -type f -exec cp --parents {} ./dist \\;" 
    for this
    "html": "cd app && tsc && find . \( -name '.html' -or -name '*.css' \) -type f -exec cp --parents {} ../dist \\;"
    and is working good. Compile and copy html and css files in one instruction I also added this
    "clean": "rm -rf dist"
    in order to remove the whole directory dist. Hope this help!

提交回复
热议问题