Skip to content

Commit

Permalink
fix: umd 中替换环境变量 (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud authored Jun 20, 2024
1 parent b32225e commit 96885db
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"@nutui/icons-react-taro": "^1.0.4",
"@nutui/touch-emulator": "^1.0.0",
"@react-spring/web": "~9.6.1",
"@types/fs-extra": "^11.0.4",
"@use-gesture/react": "10.2.20",
"async-validator": "^4.2.5",
"classnames": "^2.5.1",
Expand All @@ -118,6 +119,9 @@
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@loadable/component": "^5.16.3",
"@mdx-js/mdx": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@mdx-js/rollup": "^3.0.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
Expand All @@ -144,6 +148,8 @@
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"autoprefixer": "^10.4.17",
"axios": "^1.6.7",
"babel-plugin-react-scoped-css": "^1.1.1",
Expand All @@ -159,15 +165,13 @@
"eslint-plugin-unused-imports": "^4.0.0",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"happy-dom": "^14.2.0",
"highlight.js": "^11.9.0",
"husky": "^9.0.11",
"inquirer": "^9.2.15",
"jscodeshift": "^0.15.1",
"lint-staged": "^15.2.2",
"lzutf8": "0.6.3",
"@mdx-js/mdx": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@mdx-js/rollup": "^3.0.1",
"highlight.js": "^11.9.0",
"map-stream": "0.0.7",
"markdown-it": "^14.0.0",
"marked": "^12.0.0",
Expand Down Expand Up @@ -204,9 +208,6 @@
"vite": "^5.1.3",
"vite-plugin-dts": "3.6.4",
"vitest": "^1.4.0",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"happy-dom": "^14.2.0",
"vitest-canvas-mock": "^0.3.3"
},
"peerDependencies": {
Expand Down
32 changes: 24 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vite.config.build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if (projectID) {
}
// https://vitejs.dev/config/
export default defineConfig({
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
},
resolve: {
alias: [{ find: '@', replacement: resolve(__dirname, './src') }],
},
Expand Down Expand Up @@ -73,7 +76,7 @@ export default defineConfig({
react: 'React',
'react-dom': 'ReactDOM',
},
name: 'nutui.react',
name: 'nutui',
format: 'umd',
entryFileNames: 'nutui.react.umd.js',
},
Expand Down

0 comments on commit 96885db

Please sign in to comment.