feat: external dependencies

This commit is contained in:
草鞋没号 2022-01-05 09:09:16 +08:00
parent 252a5eefed
commit fc93d313fa
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import { join } from 'path'
import { builtinModules } from 'module'
import { defineConfig } from 'vite'
import pkg from '../package.json'
export default defineConfig({
mode: process.env.NODE_ENV,
@ -15,8 +16,9 @@ export default defineConfig({
emptyOutDir: true,
rollupOptions: {
external: [
...builtinModules,
'electron',
...builtinModules,
...Object.keys((pkg as Record<string, any>).dependencies || {}),
],
output: {
entryFileNames: '[name].cjs',

View File

@ -1,6 +1,7 @@
import { join } from 'path'
import { builtinModules } from 'module'
import { defineConfig } from 'vite'
import pkg from '../package.json'
export default defineConfig({
mode: process.env.NODE_ENV,
@ -15,8 +16,9 @@ export default defineConfig({
emptyOutDir: true,
rollupOptions: {
external: [
...builtinModules,
'electron',
...builtinModules,
...Object.keys((pkg as Record<string, any>).dependencies || {}),
],
output: {
entryFileNames: '[name].cjs',