Comments (13)
@kaleidawave Wait, so this input:
{
"inputs": {
"index": "src/node.ts"
},
"format": "cjs",
"platform": "node"
},
Is writing to cjs/node.cjs
and not cjs/index.cjs
? That seems like a bug.
Also, src
is included in files
because they are required for source maps.
from packemon.
Ok, now fixed!
from packemon.
@kaleidawave That's odd, what's your config? It sets main
based on your chosen formats.
The files
is intentional. It's so you don't have to manage npmignore
yourself and only the files that should be packed will be in the tar file.
from packemon.
Yep, I have no idea, it doesn't mention ./cjs/index.cjs
in the config:
"packemon": [
{
"inputs": {
"index": "src/node.ts"
},
"format": "cjs",
"platform": "node"
},
{
"inputs": {
"bin": "src/cli.ts"
},
"platform": "node"
},
{
"inputs": {
"web": "src/web.ts"
},
"platform": "browser",
"support": "current"
},
{
"inputs": {
"import": "src/web.ts"
},
"platform": "node",
"format": "mjs",
"support": "current"
}
]
Does packemon read any other inputs..?
On adding specifically the src
to the files section: I am not sure it should be added as none of the files in src
are used in the export or main fields.
The rest of packemon is excellent but at the moment I'm having to modify these two lines between builds.
from packemon.
Yep, from that input the transpiled contents of (the entrypoint) src/node.ts
end up in cjs/node.cjs
. I think that is the desired output as forcing it to cjs/index.cjs
could mess up direct imports pointing to cjs/node.cjs
. I don't think there is any need for it to be specifically named index. Just as long as the main field points to the correct file.
from packemon.
@kaleidawave So the left-hand side of the inputs
object should be the filename, hence index
.
I'll give this exact configuration a test and see what's up.
from packemon.
@kaleidawave So I have quick test case here and given your config, it's generating the correct package.json
to me. #43
Do you have a branch or something I can check out?
from packemon.
@kaleidawave Bumping this ^^^
from packemon.
https://replit.com/@kaleidawave/packemon-package-main-issue
With the following inputs with the entrypoint src/my-entrypoint.ts
:
"packemon": [
{
"inputs": {
"index": "src/my-entrypoint.ts"
},
"format": "cjs",
"platform": "node"
}
],
Packemon builds to cjs/my-entrypoint.cjs
and dts/my-entrypoint.d.ts
but sets the main
and types
fields in package.json
to the non-existant cjs/index.cjs
and dts/index.d.ts
. I am not quite sure if this is a issue with the location it writes to or a issue with the data it writes to package.json
In the project I am currently using packemon in, I currently correct it in postbuild so I don't need this fix urgently.
from packemon.
@kaleidawave Is this still happening on the latest version? I think it may be related to not bundling, but will have to verify.
from packemon.
Hi, updated the repl to 0.16.3
and the "main"
field now correctly points to the correct entry file so that is fixed, thanks! 😃. However the "types"
field which points to the type declarations is still pointing to dts/index.d.ts
rather than dts/my-entrypoint.d.ts
.
from packemon.
@kaleidawave Haha damn. Should be an easy fix now that I know what's happening.
from packemon.
Yep, just checked and types field is correct now! Thanks 😁
from packemon.
Related Issues (20)
- `packemon build` doc is outdated? HOT 1
- `packemon build` set the wrong `main` field HOT 3
- Unable to use `PackageValidator` for non-packemon packages HOT 2
- Bug: `transform-react-jsx currently only accepts useBuiltIns or useSpread but not both` HOT 1
- Bug: subpaths for `lib` format are not generated properly HOT 5
- Bug: Assets are not being bundled properly when using esm bundle format HOT 7
- Bug: `native` platform exports are pointing to the incorrect files when also building `node` HOT 5
- Bug: browser condition block in exports is missing default HOT 6
- Bug: types not added to export map for tsx input files HOT 3
- .packemon.js config file naming no longer supported HOT 2
- Transpile without rolling up to index.js HOT 2
- ENOENT: no such file or directory, open /apps/web/package.json' HOT 1
- Add option for babelHelpers to be runtime instead of bundled HOT 2
- TypeScript library with `"type": "module"` generating `cjs` declarations with `.d.ts` suffix HOT 6
- Babel Error: `@babel/plugin-proposal-private-property-in-object ` explicit dependency HOT 5
- 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
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.