wasm-bindgen/examples/dom/webpack.config.js

28 lines
833 B
JavaScript
Raw Normal View History

2018-03-21 18:26:00 +03:00
const path = require('path');
2018-09-11 08:42:22 +03:00
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
2018-03-21 18:26:00 +03:00
module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
},
2018-09-11 08:42:22 +03:00
plugins: [
new HtmlWebpackPlugin({
template: 'index.html'
}),
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, ".")
}),
// 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']
2018-09-11 08:42:22 +03:00
})
],
mode: 'development'
2018-03-21 18:26:00 +03:00
};