chore: add debugBundle to write out bundle

This commit is contained in:
calebboyd
2017-09-05 23:41:25 -05:00
parent 9ecd84ff8f
commit 280b93b0a8
4 changed files with 16 additions and 1668 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import {
NexePatch
} from './options'
import cli from './steps/cli'
import bundle from './bundling/fuse'
import bundle from './steps/bundle'
import download from './steps/download'
import artifacts from './steps/artifacts'
import patches from './patches'
+1
View File
@@ -38,6 +38,7 @@ export interface NexeOptions {
verbose?: boolean
info?: boolean
ico?: string
debugBundle?: boolean
warmup?: string
compress?: boolean
clean?: boolean
+5 -1
View File
@@ -1,6 +1,6 @@
import { NexeCompiler } from '../compiler'
import { FuseBox, JSONPlugin, CSSPlugin, HTMLPlugin, QuantumPlugin } from 'fuse-box'
import { readFileAsync } from '../util'
import { readFileAsync, writeFileAsync } from '../util'
//import NativeModulePlugin from './fuse-native-module-plugin'
function createBundle(filename: string, options: { name: string; minify: any; cwd: string }) {
@@ -53,5 +53,9 @@ export default async function bundle(compiler: NexeCompiler, next: any) {
name: compiler.options.name,
minify: compiler.options.compress
})
if (compiler.options.debugBundle) {
await writeFileAsync(compiler.options.debugBundle, compiler.input)
}
return next()
}