-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.worklets.common.js
55 lines (54 loc) · 1.88 KB
/
webpack.worklets.common.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
48
49
50
51
52
53
54
55
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
devtool: 'source-map',
entry: {
worklets: [
'./node_modules/reactive-synth-envelope-generator/envelope-generator.js',
'./node_modules/reactive-synth-clock-divider/clock-divider.js',
'./node_modules/reactive-synth-noise-generator/noise-generator.js',
'./node_modules/reactive-synth-bitcrusher/bitcrusher.js',
'./node_modules/reactive-synth-inverse-gain/inverse-gain.js'
]
},
output: {
publicPath: './assets/audio-worklet-processors',
path: path.join(__dirname, 'src', 'assets', 'audio-worklet-processors'),
filename: '[name].[contenthash].js'
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/reactive-synth-inverse-gain/reactive_synth_inverse_gain.wasm',
// somehow it knows to copy to the assets folder
to: '[name].[contenthash].[ext]',
toType: 'template'
},
{
from: 'node_modules/reactive-synth-bitcrusher/reactive_synth_bitcrusher.wasm',
to: '[name].[contenthash].[ext]',
toType: 'template'
},
{
from: 'node_modules/reactive-synth-noise-generator/reactive_synth_noise_generator.wasm',
to: '[name].[contenthash].[ext]',
toType: 'template'
},
{
from: 'node_modules/reactive-synth-clock-divider/reactive_synth_clock_divider.wasm',
to: '[name].[contenthash].[ext]',
toType: 'template'
},
{
from: 'node_modules/reactive-synth-envelope-generator/reactive_synth_envelope_generator.wasm',
to: '[name].[contenthash].[ext]',
toType: 'template'
},
]
})
]
};