mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 17:57:36 +08:00
The breaking changes listed in https://github.com/karma-runner/karma/releases/tag/v5.0.0 do not apply to us. This should also include support for Edgium per https://github.com/karma-runner/karma/pull/3440 R=jacktfranklin@chromium.org DISABLE_THIRD_PARTY_CHECK=Update karma Bug: 1068145 Change-Id: I7567b2db14dbf59aaf9c091220157bf55d155810 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144050 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
27 lines
684 B
JavaScript
27 lines
684 B
JavaScript
'use strict'
|
|
const PathUtils = require('./path-utils')
|
|
const fs = require('fs')
|
|
|
|
const BundleUtils = {
|
|
bundleResource (inPath, outPath) {
|
|
return new Promise((resolve, reject) => {
|
|
require('browserify')(inPath)
|
|
.bundle()
|
|
.pipe(fs.createWriteStream(outPath))
|
|
.once('finish', () => resolve())
|
|
.once('error', (e) => reject(e))
|
|
})
|
|
},
|
|
|
|
bundleResourceIfNotExist (inPath, outPath) {
|
|
inPath = PathUtils.calculateAbsolutePath(inPath)
|
|
outPath = PathUtils.calculateAbsolutePath(outPath)
|
|
|
|
return fs.existsSync(outPath)
|
|
? Promise.resolve()
|
|
: BundleUtils.bundleResource(inPath, outPath)
|
|
}
|
|
}
|
|
|
|
module.exports = BundleUtils
|