mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 20:07:06 +08:00
feat: external dependencies
This commit is contained in:
parent
252a5eefed
commit
fc93d313fa
@ -1,6 +1,7 @@
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { builtinModules } from 'module'
|
import { builtinModules } from 'module'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
|
import pkg from '../package.json'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
mode: process.env.NODE_ENV,
|
mode: process.env.NODE_ENV,
|
||||||
@ -15,8 +16,9 @@ export default defineConfig({
|
|||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: [
|
external: [
|
||||||
...builtinModules,
|
|
||||||
'electron',
|
'electron',
|
||||||
|
...builtinModules,
|
||||||
|
...Object.keys((pkg as Record<string, any>).dependencies || {}),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: '[name].cjs',
|
entryFileNames: '[name].cjs',
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { builtinModules } from 'module'
|
import { builtinModules } from 'module'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
|
import pkg from '../package.json'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
mode: process.env.NODE_ENV,
|
mode: process.env.NODE_ENV,
|
||||||
@ -15,8 +16,9 @@ export default defineConfig({
|
|||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: [
|
external: [
|
||||||
...builtinModules,
|
|
||||||
'electron',
|
'electron',
|
||||||
|
...builtinModules,
|
||||||
|
...Object.keys((pkg as Record<string, any>).dependencies || {}),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: '[name].cjs',
|
entryFileNames: '[name].cjs',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user