-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
68 lines (65 loc) · 2.03 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const lwcLoaderPath = require.resolve('./lwc-loader.js');
const path = require('path');
const fs = require('fs');
const lwcNamespace = 'ffmpeg';
const lwcAliases = fs.readdirSync('./src/ffmpeg').reduce((seed, dirName) => {
seed[`${lwcNamespace}/${dirName}`] = path.resolve('./src/ffmpeg', dirName, `${dirName}.ts`);
return seed;
}, {});
module.exports = {
mode: 'development',
entry: './src/index.ts',
output: {
path: __dirname + "/public",
filename: "ffmpeg.js",
publicPath: '/',
},
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".js", ".css", ".html"],
alias: {
event: path.resolve('./src/event'),
util: path.resolve('./src/util'),
store: path.resolve('./src/store'),
lwc: '@lwc/engine',
'wire-service': '@lwc/wire-service',
...lwcAliases,
cmp: path.resolve('./src/ffmpeg'),
notes: path.resolve('./src/notes'),
keyboard: path.resolve('./src/keyboard'),
markers: path.resolve('./src/markers'),
units: path.resolve('./src/units'),
audio: path.resolve('./src/audio'),
}
},
module: {
rules: [
{
test: /ffmpeg(.)+\.(css|html)$/,
loader: lwcLoaderPath,
options: {
namespace: lwcNamespace,
}
},
{
test: /\.js$/,
loader: 'babel-loader',
options: {
plugins: [
'@babel/plugin-proposal-class-properties'
]
}
},
{
test: /\.(tsx?)$/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-typescript'],
plugins: [
'@lwc/babel-plugin-component'
]
}
},
]
}
}