-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpackBaseConfig.js
59 lines (58 loc) · 1.88 KB
/
webpackBaseConfig.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
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require('path');
// This module isn't used to build the documentation. We use Next.js for that.
// This module is used by the visual regression tests to run the demos.
module.exports = {
context: path.resolve(__dirname),
resolve: {
modules: [__dirname, 'node_modules'],
alias: {
'@mui/x-data-grid': path.resolve(__dirname, './packages/grid/x-data-grid/src'),
'@mui/x-data-grid-generator': path.resolve(
__dirname,
'./packages/grid/x-data-grid-generator/src',
),
'@mui/x-data-grid-pro': path.resolve(__dirname, './packages/grid/x-data-grid-pro/src'),
'@mui/x-data-grid-premium': path.resolve(
__dirname,
'./packages/grid/x-data-grid-premium/src',
),
'@mui/x-date-pickers': path.resolve(__dirname, './packages/x-date-pickers/src'),
'@mui/x-date-pickers-pro': path.resolve(__dirname, './packages/x-date-pickers-pro/src'),
'@mui/x-license-pro': path.resolve(__dirname, './packages/x-license-pro/src'),
'@mui/markdown': path.resolve(__dirname, './node_modules/@mui/monorepo/packages/markdown'),
docs: path.resolve(__dirname, './node_modules/@mui/monorepo/docs'),
docsx: path.resolve(__dirname, './docs'),
},
extensions: ['.js', '.ts', '.tsx', '.d.ts'],
},
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/build/',
},
target: 'web',
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules\/(?!@mui)/,
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
{
test: /\.md$/,
loader: 'raw-loader',
},
{
test: /\.(ts|tsx)$/,
loader: 'string-replace-loader',
options: {
search: '__RELEASE_INFO__',
replace: 'MTU5NjMxOTIwMDAwMA==', // 2020-08-02
},
},
],
},
};