chore: inject source-map-support
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user