Comments (12)
@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.
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.
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.
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.
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.
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.
@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 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.
@svallory Curious, if you delete the rollup format build, and use tsc
instead, what features of pack
do you want exactly?
from packemon.
@svallory Curious, if you delete the rollup format build, and use
tsc
instead, what features ofpack
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.
@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.
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)
- any way to add rollup plugins? HOT 2
- Sourcemaps don't seem to be generated correctly
- clean command is not working HOT 1
- "helpers" feature not removing babelHelpers HOT 2
- [Docs] Meaning of directory name colors of `npx packemon files` HOT 1
- UNLICENSED package cannot pass license validation HOT 1
- Is it possible to disable asset imports? HOT 3
- "default" is imported from external module "react" but never used in "src/file.tsx" HOT 10
- .css.ts imports not inlined in output HOT 13
- Add configuration options as parameters to `scaffold` HOT 2
- packemon 4 version is still `0.0.0-internal` HOT 4
- [4.0] Scaffold for polyrepo generates `tsconfig.build.json` but looks for `tsconfig.mjs.json` HOT 1
- Question/Feature Request: How to replace the build step? HOT 6
- '--loadConfigs' does not load Babel plugins specified in babel.config.json HOT 8
- Types *must* be imported with `type` keyword when TS `compilerOptions.verbatimModuleSyntax` is `true`
- Declarations not included and Types not satisifed by inclusion of src (broken sourcemaps) HOT 4
- Add the `@babel/plugin-syntax-import-attributes` plugin to allow JSON imports with type assertion HOT 11
- MJS wrappers of ./cjs/subdir/*.js are incorrectly created at ./cjs/*-wrapper.mjs HOT 2
- Scan package lock file (or deps?) for highest minimum engine requirements for --addEngines HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packemon.