diff --git a/packages/system/babel.config.js b/packages/system/babel.config.js deleted file mode 100644 index ec8a4a38ad..0000000000 --- a/packages/system/babel.config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - env: { - esm: { - presets: [['@babel/preset-env', { modules: false }]], - }, - cjs: { - presets: ['@babel/preset-env'], - }, - test: { - presets: [['@babel/preset-env'], '@babel/preset-react'], - }, - }, -}; diff --git a/packages/system/package.json b/packages/system/package.json index a563773b7f..d1768cdeb1 100644 --- a/packages/system/package.json +++ b/packages/system/package.json @@ -9,15 +9,17 @@ ], "homepage": "https://gympass.github.io/yoga/", "license": "MIT", - "main": "src", + "main": "./src", + "types": "./src", "repository": { "type": "git", "url": "git+https://github.com/Gympass/yoga.git" }, "scripts": { - "build": "yarn build:cjs && yarn build:esm", - "build:cjs": "NODE_ENV=cjs babel ./src --out-dir dist/cjs", - "build:esm": "NODE_ENV=esm babel ./src --out-dir dist/esm", + "build": "yarn build:types && yarn build:cjs && yarn build:esm", + "build:types": "tsup --outDir dist/typings --dts-only", + "build:cjs": "tsup --outDir dist/cjs --format=cjs", + "build:esm": "tsup --format=esm --legacy-output", "prebuild": "rm -rf ./dist", "prepublishOnly": "node ../../scripts/prepublish.js" }, @@ -36,5 +38,14 @@ "publishConfig": { "access": "public", "directory": "dist" + }, + "tsup": { + "entry": [ + "src/index.ts", + "src/**/*.(t|j)s", + "!src/**/*.test.(t|j)s" + ], + "splitting": false, + "bundle": false } } diff --git a/packages/system/src/index.js b/packages/system/src/index.ts similarity index 100% rename from packages/system/src/index.js rename to packages/system/src/index.ts