@docsvision/management-console-extension-build 6.2.5 → 6.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/vite.base.config.js +16 -15
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@docsvision/management-console-extension-build",
3
- "version": "6.2.5",
3
+ "version": "6.2.7",
4
4
  "description": "Helper tools for building Management Console extensions.",
5
5
  "scripts": {},
6
6
  "dependencies": {
7
- "autoprefixer": "10.5.1",
7
+ "autoprefixer": "10.5.0",
8
8
  "postcss-custom-properties": "15.0.1",
9
9
  "tslib": "2.8.1",
10
10
  "typescript": "6.0.3",
@@ -1,11 +1,11 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from "fs";
2
- import { defineConfig } from "vite";
2
+ import { defineConfig, esmExternalRequirePlugin } from "vite";
3
3
  import react from "@vitejs/plugin-react";
4
4
  import autoprefixer from "autoprefixer";
5
5
  import postcssCustomProperties from "postcss-custom-properties";
6
6
  import path from "path";
7
7
 
8
- const EXTERNAL_EXACT = new Set([
8
+ const EXTERNAL_LIST = [
9
9
  "react",
10
10
  "react-dom",
11
11
  "@emotion/react",
@@ -16,18 +16,14 @@ const EXTERNAL_EXACT = new Set([
16
16
  "@mui/system",
17
17
  "@mui/private-theming",
18
18
  "@mui/x-tree-view",
19
- ]);
19
+ "^@emotion/react/.*",
20
+ "^@mui/styled-engine/.*",
21
+ "^@mui/material/.*",
22
+ "^@mui/system/.*",
23
+ "^@mui/private-theming/.*",
24
+ "^@mui/x-tree-view/.*"
25
+ ]
20
26
 
21
- const isExternal = (id) => {
22
- if (EXTERNAL_EXACT.has(id)) return true;
23
- if (id.startsWith("@emotion/react/")) return true;
24
- if (id.startsWith("@mui/styled-engine/")) return true;
25
- if (id.startsWith("@mui/material/")) return true;
26
- if (id.startsWith("@mui/system/")) return true;
27
- if (id.startsWith("@mui/private-theming/")) return true;
28
- if (id.startsWith("@mui/x-tree-view/")) return true;
29
- return false;
30
- };
31
27
 
32
28
  const globals = (id) => {
33
29
  if (id === "react") return "React";
@@ -106,7 +102,13 @@ export function getBaseConfig(
106
102
 
107
103
  return {
108
104
  define: { "process.env.NODE_ENV": JSON.stringify("production") },
109
- plugins: [react(), injectManagementConsoleCssPlugin],
105
+ plugins: [
106
+ esmExternalRequirePlugin({
107
+ external: EXTERNAL_LIST
108
+ }),
109
+ react(),
110
+ injectManagementConsoleCssPlugin
111
+ ],
110
112
  css: {
111
113
  postcss: { plugins: [autoprefixer(), postcssCustomProperties()] },
112
114
  devSourcemap: true,
@@ -130,7 +132,6 @@ export function getBaseConfig(
130
132
  formats: ["umd"],
131
133
  },
132
134
  rollupOptions: {
133
- external: isExternal,
134
135
  output: {
135
136
  format: "umd",
136
137
  name,