fix: resources not being included on Windows (#701)
This commit is contained in:
@@ -3,13 +3,18 @@ import * as globs from 'globby'
|
||||
import { NexeCompiler } from '../compiler'
|
||||
|
||||
export default async function resource(compiler: NexeCompiler, next: () => Promise<any>) {
|
||||
const { cwd } = compiler.options
|
||||
if (!compiler.options.resources.length) {
|
||||
const { cwd, resources } = compiler.options
|
||||
if (!resources.length) {
|
||||
return next()
|
||||
}
|
||||
const step = compiler.log.step('Bundling Resources...')
|
||||
let count = 0
|
||||
await each(globs(compiler.options.resources, { cwd }), async file => {
|
||||
|
||||
// workaround for https://github.com/sindresorhus/globby/issues/127
|
||||
// and https://github.com/mrmlnc/fast-glob#pattern-syntax
|
||||
const resourcesWithForwardSlashes = resources.map(r => r.replace(/\\/g, '/'))
|
||||
|
||||
await each(globs(resourcesWithForwardSlashes, { cwd }), async file => {
|
||||
if (await isDirectoryAsync(file)) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user