MCPcopy
hub / github.com/josdejong/mathjs / bundle

Function bundle

gulpfile.js:115–142  ·  view source on GitHub ↗
(done)

Source from the content-addressed store, hash-verified

113const compiler = webpack(webpackConfig)
114
115function 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
144function compileCommonJs () {
145 // create a package.json file in the commonjs folder

Callers

nothing calls this directly

Calls 1

createBannerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…