angular cli build put static files in root of /dist for given project

Viewed 2372

Hi I have some static files that I need copied to the root of the apps dist dir (not in myapp/dist/assets) Is there way to configure the angular.json file to do this during a ng build?

angular v 6.0.3

1 Answers

You need to add script commands inside package.json.

scripts: {
"copyAssets": "cp -r src/assets/* dist/assets/ || copy /Y src/assets/* dist/assets/ ",
}

You can include 'npm run copyAssets' in the build script.

Related