From a4db04dbee2c9adfed4cbff4ee82ef147926a549 Mon Sep 17 00:00:00 2001 From: Roy Razon Date: Tue, 14 Jan 2020 16:47:35 +0200 Subject: [PATCH] fix: resources not being included on Windows (#701) --- src/steps/resource.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/steps/resource.ts b/src/steps/resource.ts index d49fd84..9e2a3aa 100644 --- a/src/steps/resource.ts +++ b/src/steps/resource.ts @@ -3,13 +3,18 @@ import * as globs from 'globby' import { NexeCompiler } from '../compiler' export default async function resource(compiler: NexeCompiler, next: () => Promise) { - 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 }