question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change the outDir of the transpiled code

See original GitHub issue

I don’t like the js files being generated next to my ts/ng files , it’s so annoying , so I was trying to put the compiled/transpiled js files outside the app directory, as any Angular app.

what I did is :

I added outDir to the compilerOptions inside the tsconfig.json file

{
    "compilerOptions": {
        "outDir": "./compiled/",
....

and changed the main entrypoint inside app/package.json

{
  "android": {
    "v8Flags": "--expose_gc"
  },
  "main": "./compiled/main.js",

by doing so the app crashes since it can’t find the main.js

what is the correct way to achieve that?

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:53 (14 by maintainers)

github_iconTop GitHub Comments

29reactions
GeorgeKnapcommented, Dec 6, 2017
  • not everyone is using VS code or any editor with the ability to hide transpiled files
  • Some version control systems might try to add transpiled files into version control each time the files are generated. Separate dist folder can be easily put into version control system’s ignore list.
  • Imagine you’d like to .zip you project for any reason. There is no need to include any unnecessary files which would increase the .zip file size.

Ideally I would like to set the tsconfig.json’s outDir under root folder where also node_modules are.

18reactions
BenLorantfycommented, Jul 15, 2018

This should be a top priority. Separating src and build files is an extremely common workflow. Your personal opinions are not valid reasons to ignore your community.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NativeScript change the outDir of the transpiled code
after searching for a long time , I found this :- using Visual Studio code settings for hiding files.
Read more >
change the outDir of the transpiled code - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >
Configuring TypeScript compiler - inDepthDev
By default, TS compiler outputs transpiled files to the same directory where the original TS files is found. However, this can be changed...
Read more >
TSConfig Reference - Docs on every TSConfig option
Intro to the TSConfig Reference​​ A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript...
Read more >
Typescript — How to solve the problem with unresolved path ...
After that, look for any transpiled JavaScript .js file under the outDir folder, and for each one check to see if there are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found