Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

*.d.ts, *.js, and *.metadata.json files are getting generated in my src directory when using angular 2 barrels #136

Closed
tadchristiansenli opened this issue Oct 11, 2016 · 10 comments

Comments

@tadchristiansenli
Copy link

*.d.ts, *.js, and *.metadata.json files are getting generated in my src directory when using angular 2 barrels. If I remove the barrel, then they are not generated in the src directory.

It would be nice if they were not put in the src directory because when you try and build again the linter and the build fails because it is not expecting those files to be there.

Steps to reproduce:

  1. Create a barrel for a one of your ts files (I tried putting it both outside and inside the source directory and still had the issue)
  2. Update you other ts files to use the barrel to import the class in the ts file.
  3. Run "ionic run android"

Result
*.d.ts, *.js, and *.metadata.json files are get generate next to the *.ts files in the src directory (at least the ones using barrels do)

"scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "config": {
    "ionic_rollup": "./scripts/rollup.config.js"
  }

Which @ionic/app-scripts version are you using?
ionic CLI 2.1.0
ionic 2 RC0
angular 2.0.1
@ionic/app-scripts 0.0.30 (latest)

@jgw96
Copy link
Contributor

jgw96 commented Oct 12, 2016

Hello, thanks for using Ionic! I am going to close this issue as a duplicate of #105.

@jgw96 jgw96 closed this as completed Oct 12, 2016
@tadchristiansenli
Copy link
Author

@jgw96 Is this really the same issue? They were getting the following error:
Error: Module .../ionic/src/app/index.ts does not export ComponentData (imported by .../src/components/module-components/module-component/module-component.ts) at Module.trace (.../node_modules/rollup/dist/rollup.js:7706:29)

I am not getting that error. It builds fine if I delete all those files. I am just getting metadata files generated in my source directory when using barrels. Help me understand how this is the same issue as #105

@tadchristiansenli
Copy link
Author

@jgw96 I am not trying to be annoying. I know you guys are hard at work fixing things. I just want to make sure my issue doesn't get lost. Are you sure this is the same issue as #105? It has to do with barrels, but it appears to me to be a separate issue for me. Would you be able to clarify why you think this is the same issue.

Thanks for ionic and keep up the good work!

@kleeb
Copy link

kleeb commented Oct 17, 2016

Look like its fixed with Ionic RC1 + Angular 2.1.0.

@marcsyp
Copy link

marcsyp commented Nov 21, 2016

I have updated my app to RC2 and still having this problem. Is it possible that I have some leftover build options that are still screwing things up? Any ideas?

Thanks,
Marc

@marcsyp
Copy link

marcsyp commented Nov 21, 2016

For information...

tsconfig.json:

{ "compilerOptions": { "allowSyntheticDefaultImports": true, "declaration": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "dom", "es2015" ], "module": "es2015", "moduleResolution": "node", "target": "es5" }, "exclude": [ "node_modules" ], "compileOnSave": false, "atom": { "rewriteTsconfig": false } }

And tsconfig.tmp.json:

{ "compilerOptions": { "allowSyntheticDefaultImports": true, "declaration": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "dom", "es2015" ], "module": "es2015", "moduleResolution": "node", "target": "es5", "outDir": "{{MyRepo}}\\.tmp" }, "exclude": [ "node_modules" ], "compileOnSave": false, "atom": { "rewriteTsconfig": false }, "include": [ "{{MyRepo}}\\src\\app\\main.dev.ts", "{{MyRepo}}\\msyp\\Documents\\Bitbucket\\immersive-patient-room\\src\\**\\*.d.ts" ] }

It seems like the "include" section might be causing problems? No idea.

@kleeb
Copy link

kleeb commented Nov 21, 2016

add

  "include": [
    "src/**/*.ts"
  ]

in your tsconfig

@marcsyp
Copy link

marcsyp commented Nov 21, 2016

Thanks for the response -- unfortunately that didn't help. Also tried changing "sourceMap" to false, as I thought maybe that was part of it, but no change. Any other ideas?

Thanks.

@marcsyp
Copy link

marcsyp commented Nov 21, 2016

The good news is that for some reason the build is not failing anymore, at the very least... still wondering why all these files started appearing in my src folder...

@tadchristiansenli
Copy link
Author

They are needed for AoT compilation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants