diff --git a/README.md b/README.md index 4e6f873..25ee09e 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ compile({ - If a string is provided it must be a valid relative module path and should provide an export with the following signature: ```typescript - export function createBundle (options: NexeOptions): Promise` + export function createBundle (options: NexeOptions): Promise ``` - default: true - #### `name: string` diff --git a/src/steps/bundle.ts b/src/steps/bundle.ts index 1c3c32a..76cf20b 100644 --- a/src/steps/bundle.ts +++ b/src/steps/bundle.ts @@ -1,6 +1,7 @@ import { NexeCompiler } from '../compiler' import { FuseBox, JSONPlugin, CSSPlugin, HTMLPlugin, QuantumPlugin } from 'fuse-box' import { readFileAsync, writeFileAsync } from '../util' +import { resolve } from 'path' import NativeModulePlugin from '../bundling/fuse-native-module-plugin' import { NexeOptions } from '../options' @@ -46,7 +47,7 @@ export default async function bundle(compiler: NexeCompiler, next: any) { let producer = createBundle if (typeof compiler.options.bundle === 'string') { - producer = require(compiler.options.bundle).createBundle + producer = require(resolve(compiler.options.cwd, compiler.options.bundle)).createBundle } compiler.input = await producer(compiler.options)