-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathwebpack.config.js
More file actions
47 lines (46 loc) · 1.23 KB
/
Copy pathwebpack.config.js
File metadata and controls
47 lines (46 loc) · 1.23 KB
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 webpack = require('webpack');
const path = require('path');
const Dotenv = require('dotenv-webpack');
module.exports = {
mode: 'production',
entry: './components/embed-popup/standalone-bundle-root.tsx', // Input file
output: {
path: path.resolve(__dirname, 'public'),
filename: 'embed-popup.js', // Output file
},
devtool: 'source-map', // Equivalent to sourcemap: true
resolve: {
alias: { '@/*': path.resolve(__dirname, '*') },
extensions: ['.tsx', '.ts', '.js'], // Resolve TypeScript and JS files
},
plugins: [
// NOTE: the below doesn't whitelist, see https://github.com/mrsteele/dotenv-webpack/issues/41
new Dotenv({
systemvars: true,
path: '.env.local',
}),
],
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'ts-loader',
options: {
configFile: 'tsconfig.webpack.json',
},
},
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['css-loader', 'postcss-loader'],
exclude: /node_modules/,
},
],
},
externals: {
// Mark LiveKitEmbedFixed as an external global (optional depending on usage)
LiveKitEmbedFixed: 'LiveKitEmbedFixed',
},
};