TSUP working properly
This commit is contained in:
@@ -2,29 +2,15 @@
|
||||
"name": "@trigger.dev/react",
|
||||
"version": "1.0.0-next.2",
|
||||
"description": "Trigger.dev React SDK",
|
||||
"type": "module",
|
||||
"types": "build/legacy/index.d.ts",
|
||||
"main": "build/legacy/index.js",
|
||||
"module": "build/legacy/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./build/modern/index.d.ts",
|
||||
"default": "./build/modern/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./build/modern/index.d.ts",
|
||||
"default": "./build/modern/index.js"
|
||||
}
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trigger.dev/internal": "workspace:*",
|
||||
"@trigger.dev/tsconfig": "workspace:*",
|
||||
@@ -39,7 +25,7 @@
|
||||
"tsx": "^3.12.1"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf build",
|
||||
"clean": "rimraf dist",
|
||||
"build": "npm run clean && npm run build:tsup",
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
{
|
||||
"include": ["./src/**/*.ts", "./src/**/*.tsx", "tsup.config.js"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"allowUnreachableCode": false,
|
||||
"allowUnusedLabels": false,
|
||||
"baseUrl": ".",
|
||||
"checkJs": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "Node",
|
||||
"noEmit": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "ES2020",
|
||||
"jsx": "react",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"lib": ["es2015", "dom"],
|
||||
"paths": {
|
||||
"@trigger.dev/internal": ["../internal/src/index"],
|
||||
"@trigger.dev/internal/*": ["../internal/src/*"]
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
import { defineConfig } from "tsup";
|
||||
import { esbuildPluginFilePathExtensions } from "esbuild-plugin-file-path-extensions";
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
entry: ["src/*.ts", "src/*.tsx"],
|
||||
format: ["cjs", "esm"],
|
||||
target: ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77"],
|
||||
outDir: "build/modern",
|
||||
dts: true,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
noExternal: ["@trigger.dev/internal"],
|
||||
esbuildPlugins: [esbuildPluginFilePathExtensions({ esmExtension: "js" })],
|
||||
},
|
||||
{
|
||||
entry: ["src/*.ts", "src/*.tsx"],
|
||||
format: ["cjs", "esm"],
|
||||
target: ["es2020", "node16"],
|
||||
outDir: "build/legacy",
|
||||
dts: true,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
noExternal: ["@trigger.dev/internal"],
|
||||
esbuildPlugins: [esbuildPluginFilePathExtensions({ esmExtension: "js" })],
|
||||
},
|
||||
]);
|
||||
|
||||
// {
|
||||
// entry: ["src/*.ts", "src/*.tsx"],
|
||||
// format: ["cjs", "esm"],
|
||||
// target: ["es2020", "node16"],
|
||||
// outDir: "dist",
|
||||
// dts: true,
|
||||
// sourcemap: true,
|
||||
// clean: true,
|
||||
// outExtension({ format }) {
|
||||
// switch (format) {
|
||||
// case "cjs":
|
||||
// return { js: ".cjs" };
|
||||
// case "esm":
|
||||
// return { js: ".js" };
|
||||
// default:
|
||||
// return { js: ".js" };
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
@@ -0,0 +1,19 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
entry: ["src/index.ts"],
|
||||
target: "es2018",
|
||||
external: ["react"],
|
||||
sourcemap: true,
|
||||
dts: true,
|
||||
bundle: true,
|
||||
format: ["esm", "cjs"],
|
||||
noExternal: ["@trigger.dev/internal"],
|
||||
esbuildOptions(options) {
|
||||
options.banner = {
|
||||
js: '"use client";',
|
||||
};
|
||||
},
|
||||
},
|
||||
]);
|
||||
Reference in New Issue
Block a user