Skip to content

Instantly share code, notes, and snippets.

@ianjsikes
Created June 20, 2017 20:26
Show Gist options
  • Save ianjsikes/263bfe4759e999f4b50c0e489add3bc1 to your computer and use it in GitHub Desktop.
Save ianjsikes/263bfe4759e999f4b50c0e489add3bc1 to your computer and use it in GitHub Desktop.
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: __dirname + '/build',
},
module: {
rules: [
{
test: /\.rs$/,
use: {
loader: 'rust-wasm-loader',
options: {
// The path to the webpack output relative to the project root
path: 'build'
}
}
}
]
},
// The .wasm 'glue' code generated by Emscripten requires these node builtins,
// but won't actually use them in a web environment. We tell Webpack to not resolve those
// require statements since we know we won't need them.
externals: {
'fs': true,
'path': true,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment