Coder Social home page Coder Social logo

tsconfig.json suggestions about fuse-box HOT 4 CLOSED

fuse-box avatar fuse-box commented on May 14, 2024
tsconfig.json suggestions

from fuse-box.

Comments (4)

devmondo avatar devmondo commented on May 14, 2024 1

the way i see it is really simple, just provide option to take the path relative to project dir, and feed it to TS and that is all. Fuse is now and should always be transparent about plugins, in essence it should only receive content wither it is compiled or not and do the bundling.

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

Thank you very much for the ideas.
Good thinking. I was expecting someone to raise that topic sooner or later =)

  • tsconfig.json will be configurable (it was on my list)
  • Can be done (any suggestions how?)
  • I guess it's a bug. .tsx should trigger typescript mode.

When you are in typescript mode and do an import that looks like import foo from "./foo" FuseBox has to know that you are referring to a .ts extension not .js

Let me know what you think

Cheers

from fuse-box.

kdmadej avatar kdmadej commented on May 14, 2024

Regarding the strictness: I think this suggestion is a plausible approach (read the contents, minify, feed into JSON.parse).
Another way to do this would be to mimic the behaviour of ts itself, as depicted in the pr that introduced comments to tsconfig.

Although the best solution in my opinion would be for ts to expose a parseConfigFile method to help developers maintain a consistent way of parsing the config file across projects that depend on it. I guess I'll post a suggestion on their issue tracker.

EDIT: apparently the aforementioned parseConfigFileTextToJson() is already exposed. Example usage:

const fs = require('fs');
const ts = require('typescript');

const configPath = './tsconfig.json';
const tsconfig = fs.readFileSync(configPath).toString();
const parsedConfig = ts.parseConfigFileTextToJson(configPath, tsconfig); // the first argument seems to be used only for diagnostics
// parsedConfig.config contains the configuration object that can be passed to fuse-box

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

this is now supported, please reopen if otherwise :)

from fuse-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.