-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (40 loc) · 966 Bytes
/
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
import path from 'path';
import { fileURLToPath } from 'url';
import Dotenv from 'dotenv-webpack';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default {
mode: 'production',
entry: './src/service-worker.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.wasm$/,
type: 'asset/resource',
},
],
},
plugins: [
new Dotenv()
],
experiments: {
outputModule: true,
asyncWebAssembly: true,
syncWebAssembly: false
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
publicPath: 'auto',
filename: 'service-worker.js',
path: path.resolve(__dirname, 'dist'),
chunkFormat: 'array-push',
clean: true
},
target: 'webworker'
};