GithubHelp home page GithubHelp logo

Comments (12)

milesj avatar milesj commented on June 8, 2024

@svallory Not sure I follow, all the formats still exist in v4. If you want lib, set the format to lib, and then use tsconfig.lib.json.

from packemon.

svallory avatar svallory commented on June 8, 2024

I don't want the lib format. I want to output esm (or mjs) to the lib/ folder, and setting outDir in the tsconfig seems to have no effect.

from packemon.

svallory avatar svallory commented on June 8, 2024

On a side note, I understand packemon does not follow the tsconfig (since we need --declaration to output .d.ts regardless of what is set in the tsconfig). So it would be nice to have some documentation regarding packemon's build process and how to control it.

Right now, it's hard to understand what in the tsconfig does and what does not affect the build. And for the things that can't be configured there, where can I configure it?

from packemon.

milesj avatar milesj commented on June 8, 2024

Well, you can't control the output outside of setting the format. The format = the directory name, and that's not going to change. It's very tightly coupled to how rolldown is configured and works.

The only thing tsconfig is used for is generating declarations. I don't read the config for anything really.

from packemon.

svallory avatar svallory commented on June 8, 2024

I don't read the config for anything really.

So there's no way to control allowImplicitAny, strict, etc? Wait... actually, resolveJsonModules does have an effect. I had to change it to be able to compile the project. How is that so?

from packemon.

svallory avatar svallory commented on June 8, 2024

Oh, and there's one more thing... if I set outDir to a folder other than the packemon's expected folder, both folder's get generated with all files.

Can I disable packemon's output and use tsc while doing all the rest pack does?

from packemon.

milesj avatar milesj commented on June 8, 2024

@svallory Not really. Rollup writes to the format designated folder.

Typescript is weird, since we just call tsc. It's up to you to configure it correctly. Primarily to output declarations to the correct path (the format folder).

from packemon.

svallory avatar svallory commented on June 8, 2024

@svallory Not really. Rollup writes to the format designated folder.

Typescript is weird, since we just call tsc. It's up to you to configure it correctly. Primarily to output declarations to the correct path (the format folder).

Ok, thanks! I'm kinda picky and not being able to control compilation makes things very complicated to me. I'm used to tsc so, for me, usually it's the tool taking that control from me that gets me into trouble.

But packemon adds a lot and I don't want to give that up so I guess I'll let it build then delete the build and build again with tsc. I just did that as a test and got errors I wasn't getting from packemon pack.

tbh, typescript IS weird, but it's a weirdness I know. Using anything other than tsc to build typescript is inviting more weirdness. For example, most "fast" ts compilers drop type checking which doesn't make any sense to me. Either I add an extra typecheck step using tsc (which is slower than just building with tsc) or there's no point in using TS

Anyway, I'm closing the issue since this is not a bug. And really, thank you for the help and for packemon, it is still really great!

from packemon.

milesj avatar milesj commented on June 8, 2024

@svallory Curious, if you delete the rollup format build, and use tsc instead, what features of pack do you want exactly?

from packemon.

svallory avatar svallory commented on June 8, 2024

@svallory Curious, if you delete the rollup format build, and use tsc instead, what features of pack do you want exactly?

Lots! Automatic engines, files, and exports updates. Package validation has saved me a few times by checking if types, bin, and main are pointing to the right place, all the automatic configuration update, adding new projects via the scaffold...

from all the features packemon has, the build is the less interesting to me

from packemon.

svallory avatar svallory commented on June 8, 2024

@milesj well, to be fair, that's only true now! When this mess of cjs and mjs started, packemon would have been a life saver!

I had a lot of headaches until I found a setup that allowed me to work as I always did and compile to everything from the same source. And that's why I'm so reluctant to give away control over how the project is built

from packemon.

svallory avatar svallory commented on June 8, 2024

And there's one more thing... If I can't control the build via tsconfig, how can I configure the build and reference of pure typescript libraries? By TS libs I mean ts projects that are not node packages (at least not ones that will be consumed as packages)

I tend to do that a lot to enforce boundaries and optimize tsc build via project references. That's something that's rarely supported in monorepo and node build tools. (I'm KINDA bringing that to moon via templates)

from packemon.

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.