Add frontend tests and other stuff
[recipes.git] / frontend / webpack.config.js
1 const path = require('path');
2 const HtmlWebpackPlugin = require('html-webpack-plugin');
3 const webpack = require('webpack');
4 const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
5
6 module.exports = {
7 entry: './index.js',
8 output: {
9 path: path.resolve(__dirname, 'dist'),
10 filename: 'index.js',
11 },
12 plugins: [
13 new HtmlWebpackPlugin(),
14 new WasmPackPlugin({
15 crateDirectory: path.resolve(__dirname, ".")
16 }),
17 // Have this example work in Edge which doesn't ship `TextEncoder` or
18 // `TextDecoder` at this time.
19 new webpack.ProvidePlugin({
20 TextDecoder: ['text-encoding', 'TextDecoder'],
21 TextEncoder: ['text-encoding', 'TextEncoder']
22 })
23 ],
24 mode: 'development',
25 experiments: {
26 asyncWebAssembly: true
27 }
28 };