Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
s749312025 committed Oct 11, 2023
1 parent 21d7311 commit 3518a59
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ import dts from 'vite-plugin-dts'
// console.log(process.env);
export default defineConfig(({command, mode}) => {
const env = loadEnv(mode, process.cwd(), '')
const isLibMode = env.BUILDTYPE === 'lib'
console.log(env.BUILDTYPE);
let buildOption = env.BUILDTYPE === 'lib' ? {
let buildOption = isLibMode ? {
outDir: 'lib',
lib: {
entry: resolve(__dirname, 'src/lib/index.ts'),
name: 'index',
}
} : {}
console.log(buildOption);
return {
} : {
}
const config = {
plugins: [dts()],
build: buildOption
}

if (!isLibMode) {
config.base = './'
}


return config
})

0 comments on commit 3518a59

Please sign in to comment.