(done)
| 113 | const compiler = webpack(webpackConfig) |
| 114 | |
| 115 | function bundle (done) { |
| 116 | // update the banner contents (has a date in it which should stay up to date) |
| 117 | bannerPlugin.banner = createBanner() |
| 118 | |
| 119 | compiler.run(function (err, stats) { |
| 120 | if (err) { |
| 121 | log(err) |
| 122 | done(err) |
| 123 | } |
| 124 | const info = stats.toJson() |
| 125 | |
| 126 | if (stats.hasWarnings()) { |
| 127 | log('Webpack warnings:\n' + info.warnings.join('\n')) |
| 128 | } |
| 129 | |
| 130 | if (stats.hasErrors()) { |
| 131 | log('Webpack errors:\n' + info.errors.join('\n')) |
| 132 | done(new Error('Compile failed')) |
| 133 | } |
| 134 | |
| 135 | // create commonjs package.json file |
| 136 | fs.writeFileSync(path.join(COMPILE_BROWSER, 'package.json'), PACKAGE_JSON_COMMONJS) |
| 137 | |
| 138 | log(`bundled ${MATH_JS}`) |
| 139 | |
| 140 | done() |
| 141 | }) |
| 142 | } |
| 143 | |
| 144 | function compileCommonJs () { |
| 145 | // create a package.json file in the commonjs folder |
nothing calls this directly
no test coverage detected
searching dependent graphs…