-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
34 lines (33 loc) · 935 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
const path = require('path');
const webpack = require('webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const { EnvironmentPlugin } = require("webpack");
module.exports = {
output: {
filename: 'worker.js',
path: path.join(__dirname, 'dist'),
},
mode: 'production',
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new EnvironmentPlugin({
NOMICS_API_TOKEN: JSON.stringify(process.env.NOMICS_API_TOKEN),
PUBLIC_KEY: JSON.stringify(process.env.PUBLIC_KEY),
})
]
};