From 8860d619ff44510c3d97401c8c38c33d773919d9 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 10 Feb 2022 12:14:58 -0800 Subject: [PATCH] Add a test for vite --- test/package.json | 3 ++- test/vite/index.js | 2 ++ test/vite/package.json | 5 +++++ test/vite/vite.config.js | 12 ++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/vite/index.js create mode 100644 test/vite/package.json create mode 100644 test/vite/vite.config.js diff --git a/test/package.json b/test/package.json index ca75ab2..2f35efe 100644 --- a/test/package.json +++ b/test/package.json @@ -5,6 +5,7 @@ "@rollup/plugin-node-resolve": "9.0.0", "webpack": "4.44.2", "webpack-cli": "3.3.12", - "snowpack": "2.12.1" + "snowpack": "2.12.1", + "vite": "2.8.0" } } diff --git a/test/vite/index.js b/test/vite/index.js new file mode 100644 index 0000000..8697e6e --- /dev/null +++ b/test/vite/index.js @@ -0,0 +1,2 @@ +import { __awaiter } from "tslib"; +if (typeof __awaiter !== "function") throw new Error("Missing expected helper __awaiter"); \ No newline at end of file diff --git a/test/vite/package.json b/test/vite/package.json new file mode 100644 index 0000000..3609e6b --- /dev/null +++ b/test/vite/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "test": "../node_modules/.bin/vite build && node build/index.js" + } +} diff --git a/test/vite/vite.config.js b/test/vite/vite.config.js new file mode 100644 index 0000000..aafc1dc --- /dev/null +++ b/test/vite/vite.config.js @@ -0,0 +1,12 @@ +import { URL, fileURLToPath } from "url"; +export default { + build: { + outDir: "build", + emptyOutDir: true, + lib: { + entry: fileURLToPath(new URL("index.js", import.meta.url)), + formats: ["es"], + fileName: () => "index.js" + } + } +}; \ No newline at end of file