0

I am trying to separate the html and css files on the basis of the respective components.Here is the folder structure

enter image description here

In the above image, app is working as source containing components and respective html and css files and respective js files are generating in 'build' folder. To copy css and html files, I found out to use following script in pacakge.json from here : Angular 2 + Typescript compiler copy html and css files:

"html": "find ./app -name '*.html' -type f -exec cp --parents {} ./dist \\;" 

and running following command:

npm run html

But it is not copying the html files to 'build'. Any suggestion

Community
  • 1
  • 1
Vivek
  • 363
  • 8
  • 25
  • You might want to try Webpack, especially as part of [NG-CLI](https://cli.angular.io/). We had to deal with similar issues before with SystemJS, but once we spent an hour to switch to NG-CLI, these sorts of issues and more are handled now automatically. Our build size decreased also substantially. – Daedalon Mar 03 '17 at 10:27

1 Answers1

0

On the reference here, I tried following and it works

"html": "XCOPY /S /y .\\src\\app\\*.html .\\src\\build\\app",
"css": "XCOPY /S /y .\\src\\app\\*.css .\\src\\build\\app" 
Community
  • 1
  • 1
Vivek
  • 363
  • 8
  • 25