Files
react-native-devtools-frontend/node_modules/karma/lib/utils/bundle-utils.js
T
Tim van der Lippe ef991621e0 Update Karma to 5.0.1
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>
2020-04-15 08:03:17 +00:00

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