Wrangling TypeScript and webpack to work with Emscripten wasm stuff

This commit is contained in:
Surma
2018-05-17 11:24:40 +01:00
parent 634dfe3717
commit 7edb7f0de8
8 changed files with 170 additions and 1 deletions

View File

@@ -107,10 +107,17 @@ module.exports = function (_, env) {
loader: 'babel-loader',
// Don't respect any Babel RC files found on the filesystem:
options: Object.assign(readJson('.babelrc'), { babelrc: false })
},
{
// All the codec files define a global with the same name as their file name. `exports-loader` attaches those to `module.exports`.
test: /\/codec\/.*\.js$/,
loader: 'exports-loader',
}
]
},
plugins: [
// Ignore some of the native Node modules for any of the codecs. These files are generated by Emscripten and are supposed to also work in Node, which we dont care about.
new webpack.IgnorePlugin(/(fs)/, /\/codecs\//),
// Pretty progressbar showing build progress:
new ProgressBarPlugin({
format: '\u001b[90m\u001b[44mBuild\u001b[49m\u001b[39m [:bar] \u001b[32m\u001b[1m:percent\u001b[22m\u001b[39m (:elapseds) \u001b[2m:msg\u001b[22m\r',