chore: inject source-map-support

This commit is contained in:
calebboyd
2017-08-26 23:34:03 -05:00
parent a0d859921d
commit 5df6840972
7 changed files with 21 additions and 811 deletions
+3 -4
View File
@@ -3,11 +3,12 @@ import { FuseBox, JSONPlugin, CSSPlugin, HTMLPlugin, SourceMapPlainJsPlugin } fr
//import NativeModulePlugin from './fuse-native-module-plugin'
function bundleProducer(filename: string, name: string) {
console.error(process.cwd())
const fuse = FuseBox.init({
cache: false,
log: Boolean(process.env.NEXE_BUNDLE_DEBUG) || false,
homeDir: './',
sourceMaps: true,
homeDir: process.cwd(),
sourceMaps: false,
writeBundles: false,
output: '$name.js',
target: 'server',
@@ -32,7 +33,5 @@ export default async function bundle(compiler: NexeCompiler, next: any) {
}
compiler.input = await producer(compiler.options.input, compiler.options.name)
require('fs').writeFileSync('./bundle.js', compiler.input)
return next()
}
+3 -3
View File
@@ -1,11 +1,11 @@
import { NexeCompiler } from '../compiler'
import { bundleSourceMaps } from '../source-maps/build'
import { readFileSync } from 'fs'
import { join } from 'path'
export default async function main(compiler: NexeCompiler, next: () => Promise<void>) {
let sourceMapSupport = ''
if (true /*compiler.options.sourceMaps*/) {
sourceMapSupport = await bundleSourceMaps()
require('fs').writeFileSync('./source-map-inject.js', sourceMapSupport)
sourceMapSupport = readFileSync(join(__dirname, '../../source-map-support.js')).toString()
}
await compiler.setFileContentsAsync(