1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- const path = require('path');
- const webpack = require('webpack');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
-
- module.exports = {
- entry: './src/index.js',
- output: {
- filename: 'main.js',
- path: path.resolve(__dirname, 'dist'),
- clean: true,
- },
- resolve: {
- alias: {
- 'client': path.join(__dirname, '../pkg/')
- },
- fallback: {
- "buffer": require.resolve("buffer")
- }
- },
- devServer: {
- static: {
- directory: path.join(__dirname, 'dist'),
- },
- compress: true,
- port: 9000,
- client: {
- logging: 'none',
- progress: true,
- overlay: {
- errors: true,
- warnings: false,
- }
- },
- },
- plugins: [
- new webpack.ProvidePlugin({
- Buffer: ['buffer', 'Buffer'],
- }),
- new HtmlWebpackPlugin({
- title: 'My App',
- template: 'assets/index.html'
- })
- ],
- experiments: {
- asyncWebAssembly: true
- }
- };
|