-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.config.js
47 lines (42 loc) · 1.13 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = require('./webpack.base');
const ASSET_PATH = process.env.ASSET_PATH || '/';
/**
* @type {import('webpack').Configuration}
*/
const config = {
...baseConfig,
entry: {
index: './src/index.tsx',
fmDemo: './src/fmDemo/index.tsx',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[contenthash].js',
publicPath: ASSET_PATH,
},
plugins: [
...baseConfig.plugins,
new HtmlWebpackPlugin({
alwaysWriteToDisk: true,
title: 'Web Synth - Realtime Browser Audio Synthesis Plaform',
minify: true,
template: 'src/index.hbs',
chunks: ['index'],
}),
new HtmlWebpackPlugin({
alwaysWriteToDisk: true,
title: 'Rust + Wasm-powered FM Synthesizer',
minify: true,
template: 'src/fm-synth-demo.hbs',
filename: 'fm.html',
hash: true,
chunks: ['fmDemo'],
}),
new webpack.EnvironmentPlugin({ ASSET_PATH: '/' }),
],
};
// module.exports = smp.wrap(config);
module.exports = config;