Eugene Pankov 2 лет назад
Родитель
Сommit
90e00fdcac

+ 2 - 1
app/webpack.config.main.mjs

@@ -1,7 +1,8 @@
 import * as path from 'path'
 import wp from 'webpack'
 import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
 
 const config = {
     name: 'tabby-main',

+ 3 - 1
app/webpack.config.mjs

@@ -1,7 +1,9 @@
 import * as fs from 'fs'
 import * as path from 'path'
 import wp from 'webpack'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import { AngularWebpackPlugin } from '@ngtools/webpack'
 import { createEs2015LinkerPlugin } from '@angular/compiler-cli/linker/babel'
 const linkerPlugin = createEs2015LinkerPlugin({

+ 3 - 1
scripts/build-native.mjs

@@ -3,7 +3,9 @@ import { rebuild } from 'electron-rebuild'
 import * as path from 'path'
 import * as vars from './vars.mjs'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 
 if (process.platform === 'win32' || process.platform === 'linux') {
     process.env.ARCH = ((process.env.ARCH || process.arch) === 'arm') ? 'armv7l' : process.env.ARCH || process.arch

+ 3 - 1
scripts/generate-icon-metadata.mjs

@@ -3,7 +3,9 @@ import jsYaml from 'js-yaml'
 import fs from 'node:fs'
 import path from 'node:path'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 
 const metadata = jsYaml.load(fs.readFileSync(path.resolve(__dirname, '../node_modules/@fortawesome/fontawesome-free/metadata/icons.yml')))
 

+ 3 - 1
scripts/prepackage-plugins.mjs

@@ -6,7 +6,9 @@ import fs from 'node:fs'
 import * as vars from './vars.mjs'
 import log from 'npmlog'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 
 let target = path.resolve(__dirname, '../builtin-plugins')
 sh.mkdir('-p', target)

+ 2 - 1
scripts/vars.mjs

@@ -3,7 +3,8 @@ import * as fs from 'fs'
 import * as semver from 'semver'
 import * as childProcess from 'child_process'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
 
 const electronInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../node_modules/electron/package.json')))
 

+ 3 - 1
tabby-community-color-schemes/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => {

+ 3 - 1
tabby-core/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-electron/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-linkifier/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-local/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-plugin-manager/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-serial/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-settings/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-ssh/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-telnet/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-terminal/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => {

+ 3 - 1
tabby-web-demo/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
tabby-web/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 import config from '../webpack.plugin.config.mjs'
 
 export default () => config({

+ 3 - 1
web/webpack.config.mjs

@@ -1,5 +1,7 @@
 import * as path from 'path'
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+import * as url from 'url'
+const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
+
 
 const externals = {}
 for (const key of [