visulima / packem

A fast and modern bundler for Node.js and TypeScript.
MIT License
2 stars 0 forks source link

TODOs to finish packem #2

Open prisis opened 3 months ago

prisis commented 3 months ago

TODOs:

export default Tr;

- [x] wasm
- [x] Support preserve directives like "use client"
- [x] Add support for cjs interop for default and named export
```typescript
const test = () => {
    return "this should be in final bundle";
};

const test2 = "this should be in final bundle";

export { test2, test as default };

will return for .cjs

'use strict';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const test = /* @__PURE__ */ __name(() => {
  return "this should be in final bundle";
}, "test");
const test2 = "this should be in final bundle";

module.exports = test;
module.exports.test2 = test2;

will return for .d.cts

declare const test: () => string;
declare const test2 = "this should be in final bundle";

export { test2 };

declare const defaultExport: {
  test2: typeof test2;
} & typeof test;

export default defaultExport;

Plugins

baseUrl - a root directory from which to resolve non-relative paths, in addition to node_modules. paths - additional directories, relative to baseUrl, that should also be searched. rootDirs - virtual directories that relative paths can be resolved from



- [x] Support tsconfig paths
- [x] Allow the use of rootDirs in tsconfig for resolving https://www.typescriptlang.org/tsconfig#rootDirs
- [ ] https://www.typescriptlang.org/tsconfig#moduleSuffixes
- [x]  TypeScript Decorators
- [x] Make TS optional
- [ ] Support for TypeScript project references https://www.typescriptlang.org/docs/handbook/project-references.html
- [x] Add the new isolated-declarations
prisis commented 3 months ago
prisis commented 1 month ago
prisis commented 1 month ago
prisis commented 1 month ago
    "publishConfig": {
        "type": "module",
        "exports": {
            ".": {
                "types": "./dist/index.d.ts",
                "require": "./dist/index.js",
                "import": "./dist/index.mjs"
            }
        },
        "main": "./dist/index.js",
        "module": "./dist/index.mjs",
        "types": "./dist/index.d.ts"
    },
    "main": "./src/index.ts",
prisis commented 1 month ago
prisis commented 4 weeks ago
prisis commented 1 week ago
prisis commented 6 days ago