-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.ui.js
46 lines (45 loc) · 1.03 KB
/
webpack.config.ui.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './glitcher/index.ts',
output: {
path: path.join(__dirname, 'dist'),
filename: 'glitcher.js',
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader'],
},
{
test: /\.(woff|ttf|eot|otf|svg|woff2|png|jpg|jpeg)$/,
type: 'asset/resource',
},
],
},
plugins: [
new HtmlWebpackPlugin({ title: 'glitch2' }),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.DefinePlugin({
'window.GA_ID': process.env.GA_ID
? JSON.stringify(process.env.GA_ID)
: null,
}),
],
};