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

Move package.json to /dist

Open gretschann opened this issue 9 years ago • 4 comments

Extended .angular-cli.json by

    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico",
        "../package.json"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "styles.css"
      ],
      "scripts": [],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ]

and then run ng build the expected behaviour that the package.json is moving to /dist directory

what is wrong?

@angular/cli: 1.4.3

gretschann avatar Sep 29 '17 12:09 gretschann

What is your use case in wanting to move a configuration file into the build output directory?

Brocco avatar Sep 29 '17 13:09 Brocco

This would be nice when building AOT feature modules. I currently copy the package.json of my feature module into its aot output directory so that the package.json of my angular apps can use

"featureModule": "file:../featureModule/dist/aot"

to depend on just the aot output of that feature module rather than

"featureModule": "file:../featureModule"

Referencing the feature module from its root dir in order to include its package.json file also includes its node_modules and a lot of other things best left out.

Nothing a little post compile copy script can't do... but it would be nice to have anyhow

mspe044 avatar Oct 01 '17 03:10 mspe044

What is your use case in wanting to move a configuration file into the build output directory?

Our deploy script from git to server needed package.json. So I got our backend developers to change their scripts

gretschann avatar Oct 02 '17 15:10 gretschann

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.