forked from opentiny/tiny-engine
fix(bundle): fix env variable can not be bundle (#16)
This commit is contained in:
parent
f3c03e5b6d
commit
790720985d
|
@ -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",
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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({
|
||||
|
@ -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`,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# alpha mode, used by the "build:alpha" script
|
||||
|
||||
NODE_ENV=production
|
||||
#VITE_ORIGIN=
|
||||
# VITE_ORIGIN=
|
||||
|
|
Loading…
Reference in New Issue