Skip to content

Commit

Permalink
fix(bundle): fix env variable can not be bundle (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling authored Oct 7, 2023
1 parent f3c03e5 commit 7907209
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"module": "dist/index.js",
"exports": {
".": "./dist/index.js",
"./js/*": "./dist/js/*.js"
"./js/*": "./js/*.js"
},
"files": [
"dist"
"dist",
"js"
],
"dependencies": {
"@babel/generator": "7.18.13",
Expand All @@ -40,7 +41,6 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"glob": "^10.3.4",
"vite": "^4.3.7"
}
}
9 changes: 1 addition & 8 deletions packages/common/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { glob } from 'glob'
import { fileURLToPath } from 'node:url'

const jsEntries = glob.sync('./js/**.js').map((file) => {
return [file.slice(0, file.length - path.extname(file).length), fileURLToPath(new URL(file, import.meta.url))]
})

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -33,8 +27,7 @@ export default defineConfig({
cssCodeSplit: false,
lib: {
entry: {
index: path.resolve(__dirname, './index.js'),
...Object.fromEntries(jsEntries)
index: path.resolve(__dirname, './index.js')
},
name: 'common',
fileName: (format, entryName) => `${entryName}.js`,
Expand Down
2 changes: 1 addition & 1 deletion packages/design-core/.env.alpha
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# alpha mode, used by the "build:alpha" script

NODE_ENV=production
#VITE_ORIGIN=
# VITE_ORIGIN=

0 comments on commit 7907209

Please sign in to comment.