angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

'ng build' dist directory - need the ability to nest .js files in defined directory

Open cport1 opened this issue 10 years ago • 7 comments

I understand you can place directories in the public folder to be moved over to the dist directory.

However, for my deployment environment I need the ability to nest .js files(polyfills.bundle.js, main.bundle.js, and inline.js) in their own /js/ directory. Where can this be defined?

cport1 avatar Aug 20 '16 01:08 cport1

+1

iBasit avatar Aug 20 '16 21:08 iBasit

There isn't a way to define a subfolder where bundles are generated. I suppose you can do ng build and then process the result to put them in a folder, and change the script tags.

filipesilva avatar Aug 23 '16 14:08 filipesilva

Did you find any solutions for this?

FrankGoortani avatar Jan 05 '18 20:01 FrankGoortani

This is really old.. In today's cli you can define what gets copied to the dist directory within your "assets" array within your angular-cli.json.

{
  "project": {
    "name": "yourApp"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
....
   }
}

cport1 avatar Jan 08 '18 18:01 cport1

So how do we modify this config to copy production bundle files (generated from ng build --prod) to an "assets/js" folder?

fattslug avatar Jan 16 '18 21:01 fattslug

what is the status for this issue?. I have been facing this issue since 4 hours. Please post working steps and make me happy:) thanks in advance.

Note: my project is on angular 5

Yogeshwar1992 avatar Jun 27 '18 05:06 Yogeshwar1992

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.