fix: bump resolve-dependencies and use expand option

This commit is contained in:
calebboyd
2018-03-18 02:16:33 -05:00
committed by Caleb Boyd
parent 34f3ddc26a
commit d6d81b9e23
2 changed files with 1153 additions and 317 deletions
+1148 -312
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -10,11 +10,11 @@ function makeRelative(cwd: string, path: string) {
let producer = async function(compiler: NexeCompiler) {
const { cwd, input } = compiler.options
const { files } = await resolveFiles({ entries: [compiler.options.input], cwd, strict: false })
Object.keys(files).forEach(x => {
const file = files[x]!
if (file) {
compiler.addResource(makeRelative(cwd, x), Buffer.from(file.contents))
const { files } = await resolveFiles(compiler.options.input, { cwd, expand: true })
Object.keys(files).forEach(filename => {
const file = files[filename]!
if (file && file.contents) {
compiler.addResource(makeRelative(cwd, filename), Buffer.from(file.contents))
}
})
return Promise.resolve('require(' + JSON.stringify(makeRelative(cwd, input)) + ')')