fix: resources not being included on Windows (#701)

This commit is contained in:
Roy Razon
2020-01-14 16:47:35 +02:00
committed by Caleb Boyd
parent ec7f7f318e
commit a4db04dbee
+8 -3
View File
@@ -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
}