Use esmExternalRequirePlugin

This commit is contained in:
Michael Telatynski
2026-06-04 11:11:29 +01:00
parent 2a6e185be9
commit 2321dc8f63
4 changed files with 28 additions and 12 deletions
+7 -3
View File
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import { defineConfig, esmExternalRequirePlugin } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import externalGlobals from "rollup-plugin-external-globals";
@@ -27,8 +27,12 @@ export default defineConfig({
outDir: "lib",
target: "esnext",
sourcemap: true,
rollupOptions: {
external: ["react"],
rolldownOptions: {
plugins: [
esmExternalRequirePlugin({
external: ["react"],
}),
],
},
},
plugins: [
+7 -3
View File
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import { defineConfig, esmExternalRequirePlugin } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import externalGlobals from "rollup-plugin-external-globals";
@@ -25,8 +25,12 @@ export default defineConfig({
outDir: "lib",
target: "esnext",
sourcemap: true,
rollupOptions: {
external: ["react"],
rolldownOptions: {
plugins: [
esmExternalRequirePlugin({
external: ["react"],
}),
],
},
minify: false,
},
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import { defineConfig, esmExternalRequirePlugin } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import externalGlobals from "rollup-plugin-external-globals";
@@ -26,8 +26,12 @@ export default defineConfig({
outDir: "lib",
target: "esnext",
sourcemap: true,
rollupOptions: {
external: ["react"],
rolldownOptions: {
plugins: [
esmExternalRequirePlugin({
external: ["react"],
}),
],
},
},
plugins: [
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import { defineConfig, esmExternalRequirePlugin } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import externalGlobals from "rollup-plugin-external-globals";
@@ -27,8 +27,12 @@ export default defineConfig({
outDir: "lib",
target: "esnext",
sourcemap: true,
rollupOptions: {
external: ["react"],
rolldownOptions: {
plugins: [
esmExternalRequirePlugin({
external: ["react"],
}),
],
},
},
plugins: [