Use esmExternalRequirePlugin
This commit is contained in:
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
|
|
||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
@@ -27,8 +27,12 @@ export default defineConfig({
|
|||||||
outDir: "lib",
|
outDir: "lib",
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rolldownOptions: {
|
||||||
external: ["react"],
|
plugins: [
|
||||||
|
esmExternalRequirePlugin({
|
||||||
|
external: ["react"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
|
|
||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
@@ -25,8 +25,12 @@ export default defineConfig({
|
|||||||
outDir: "lib",
|
outDir: "lib",
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rolldownOptions: {
|
||||||
external: ["react"],
|
plugins: [
|
||||||
|
esmExternalRequirePlugin({
|
||||||
|
external: ["react"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
minify: false,
|
minify: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
|
|
||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
@@ -26,8 +26,12 @@ export default defineConfig({
|
|||||||
outDir: "lib",
|
outDir: "lib",
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rolldownOptions: {
|
||||||
external: ["react"],
|
plugins: [
|
||||||
|
esmExternalRequirePlugin({
|
||||||
|
external: ["react"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
|
|
||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
@@ -27,8 +27,12 @@ export default defineConfig({
|
|||||||
outDir: "lib",
|
outDir: "lib",
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rolldownOptions: {
|
||||||
external: ["react"],
|
plugins: [
|
||||||
|
esmExternalRequirePlugin({
|
||||||
|
external: ["react"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
Reference in New Issue
Block a user