Skip to content

Commit

Permalink
build: fix win build
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Mar 17, 2024
1 parent eb16c8a commit d6229f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { entryChunksPlugin } from 'esbuild-plugin-entry-chunks'
import minimist from 'minimist'
import glob from 'fast-glob'

const unwrapQuotes = str => str.replace(/^['"]|['"]$/g, '')
const argv = minimist(process.argv.slice(2), {
default: {
entry: './src/main/ts/index.ts',
Expand All @@ -22,12 +23,11 @@ const argv = minimist(process.argv.slice(2), {
string: ['entry', 'external', 'bundle', 'license', 'format', 'map', 'cwd']
})
const { entry, external, bundle, minify, sourcemap, license, format, cwd: _cwd } = argv

const plugins = []
const cwd = Array.isArray(_cwd) ? _cwd[_cwd.length - 1] : _cwd
const entryPoints = entry.includes('*')
? await glob(entry.split(':'), { absolute: false, onlyFiles: true, cwd })
: entry.split(':')
? await glob(unwrapQuotes(entry.split(':')), { absolute: false, onlyFiles: true, cwd })
: unwrapQuotes(entry.split(':'))

const _bundle = bundle !== 'none' && !process.argv.includes('--no-bundle')
const _external = _bundle
Expand Down Expand Up @@ -97,4 +97,4 @@ for (const format of formats) {
.catch(() => process.exit(1))
}

process.exit(0)
process.exit(0)

0 comments on commit d6229f1

Please sign in to comment.