forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (38 loc) · 986 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
const path = require('path');
const workspaceRoot = path.resolve(__dirname, '../..');
// for babel.config.js
// webpack `mode: 'production'` does not affect NODE_ENV nor BABEL_ENV in babel-loader
process.env.NODE_ENV = 'production';
module.exports = {
context: workspaceRoot,
entry: 'benchmark/browser/index.js',
mode: 'production',
output: {
path: path.join(__dirname, 'dist'),
filename: 'index.js',
},
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
cacheDirectory: true,
configFile: path.join(workspaceRoot, 'babel.config.js'),
envName: 'benchmark',
},
},
{
test: /\.(jpg|gif|png)$/,
type: 'asset/inline',
},
],
},
resolve: {
extensions: ['.js', '.ts', '.tsx'],
},
// TODO: 'browserslist:modern'
// See https://github.com/webpack/webpack/issues/14203
target: 'web',
};