From f7bf2bcfd15150021a7094ef3bf60981e36110ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Mon, 1 May 2023 04:37:10 +0200 Subject: [PATCH] Fix TS imports in bundle [publish] --- CHANGELOG.md | 4 ++++ package.json | 2 +- scripts/bundle.ts | 2 +- src/cli.ts | 2 +- tests/run-tests.ts | 14 +++++++------- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a07840d..198b312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 0.5.1 + +Fix TS imports in bundle + ## 0.5.0 Align with Tailwind 3.3: diff --git a/package.json b/package.json index 42c9a31..d9f4bee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@arnaud-barre/downwind", "description": "A PostCSS-less implementation of Tailwind based on Lightning CSS", - "version": "0.5.0", + "version": "0.5.1", "author": "Arnaud Barré (https://github.com/ArnaudBarre)", "license": "MIT", "scripts": { diff --git a/scripts/bundle.ts b/scripts/bundle.ts index 0bda40f..5cbfacc 100755 --- a/scripts/bundle.ts +++ b/scripts/bundle.ts @@ -46,7 +46,7 @@ Promise.all([ `const {${specifiers.replaceAll( " as ", ": ", - )}} = require("${from}");`, + )}} = require("${from.replace(".ts", ".js")}");`, ) .replace(`export { ${tool}Plugin as downwind };\n`, "") .concat(`module.exports.downwind = ${tool}Plugin;\n`), diff --git a/src/cli.ts b/src/cli.ts index f171c6e..074eaef 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -33,7 +33,7 @@ if (!output) { } /* eslint-disable @typescript-eslint/no-require-imports */ -require("./index.ts") +require("./index.js") .initDownwind() .then((downwind: Downwind) => { const { writeFileSync, existsSync, mkdirSync } = diff --git a/tests/run-tests.ts b/tests/run-tests.ts index bb716b3..0a263b0 100755 --- a/tests/run-tests.ts +++ b/tests/run-tests.ts @@ -9,10 +9,10 @@ declare global { (globalThis as any).__VERSION__ = "test"; /* eslint-disable @typescript-eslint/no-require-imports */ -require("./generate.test"); -require("./preTransform.test"); -require("./convertTargets.test"); -require("./cssModuleToJS.test"); -require("./codegen.test"); -require("./esbuildPlugin.test"); -require("./vitePlugin.test"); +require("./generate.test.ts"); +require("./preTransform.test.ts"); +require("./convertTargets.test.ts"); +require("./cssModuleToJS.test.ts"); +require("./codegen.test.ts"); +require("./esbuildPlugin.test.ts"); +require("./vitePlugin.test.ts");