Skip to content

Commit

Permalink
deps: use vite plugin to provide node polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip authored and trim21 committed May 19, 2024
1 parent 7806277 commit b8cacca
Show file tree
Hide file tree
Showing 4 changed files with 797 additions and 18 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@
"file-saver": "^2.0.5",
"highcharts": "^10.2.1",
"highcharts-vue": "^1.4.0",
"https-browserify": "^1.0.0",
"i18next": "^21.9.1",
"jszip": "^3.10.1",
"parse-torrent": "^11.0.16",
"path-browserify": "^1.0.1",
"stream-http": "^3.2.0",
"ua-parser-js": "^1.0.2",
"url-parse": "^1.5.10",
"vue": "~2.7.0",
Expand Down Expand Up @@ -71,6 +68,7 @@
"sass-loader": "^14.2.1",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vite-plugin-node-polyfills": "^0.21.0",
"vue-template-compiler": "~2.7.0"
},
"browserslist": [
Expand Down
4 changes: 4 additions & 0 deletions vite.config.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {defineConfig} from 'vite'
import {sharedConfig} from "./vite.config";
import fs from "node:fs";
import git from 'git-rev-sync'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import buildResource from "./vite/buildResource";

// https://vitejs.dev/config/
Expand All @@ -26,6 +27,9 @@ export default defineConfig({
copyPublicDir: false
},
plugins: [
nodePolyfills({
include: ['path'],
}),
buildResource(),
{
name: 'update_manifest_version',
Expand Down
8 changes: 7 additions & 1 deletion vite.config.content.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'node:path'
import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import {sharedConfig} from "./vite.config";

// https://vitejs.dev/config/
Expand All @@ -21,5 +22,10 @@ export default defineConfig({
chunkSizeWarningLimit: Number.MAX_SAFE_INTEGER,
emptyOutDir: false,
copyPublicDir: false
}
},
plugins: [
nodePolyfills({
include: ['path'],
}),
]
})
Loading

0 comments on commit b8cacca

Please sign in to comment.