Add #[wasm_bindgen(start)], plugins to webpack config, Update deps

This commit is contained in:
Daniel Schindler
2018-11-30 17:42:36 +01:00
parent 89e245bddf
commit caac2eba53
5 changed files with 20 additions and 5 deletions

View File

@ -1,4 +1,6 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: './index.js',
@ -6,5 +8,16 @@ module.exports = {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
},
plugins: [
new HtmlWebpackPlugin({
template: "index.html"
}),
// Have this example work in Edge which doesn't ship `TextEncoder` or
// `TextDecoder` at this time.
new webpack.ProvidePlugin({
TextDecoder: ['text-encoding', 'TextDecoder'],
TextEncoder: ['text-encoding', 'TextEncoder']
})
],
mode: 'development'
};