mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-24 18:43:33 +03:00
717cfa303d
This commit does a few things, including: * Fixing the generated JS of `wasm-bindgen` to allow polyfills to work. (a minor tweak of the generated JS) * All examples are updated to include a Webpack-specific polyfill for these two types to get examples working in Edge. * A new page has been added to the guide about supported browsers. This mentions known caveats like IE 11 requiring `wasm2js` as well as documenting some `TextEncoder` and `TextDecoder` workarounds for Edge. Closes #895
24 lines
672 B
JavaScript
24 lines
672 B
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const webpack = require('webpack');
|
|
|
|
module.exports = {
|
|
entry: './index.js',
|
|
output: {
|
|
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'
|
|
};
|