forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonosize.config.mjs
More file actions
34 lines (32 loc) · 1.06 KB
/
monosize.config.mjs
File metadata and controls
34 lines (32 loc) · 1.06 KB
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
// @ts-check
import fs from 'node:fs';
import path from 'node:path';
import webpackBundler from 'monosize-bundler-webpack';
import createAzureStorage from 'monosize-storage-azure';
/** @type {import('monosize').MonoSizeConfig} */
const config = {
repository: 'https://github.com/microsoft/fluentui',
storage: createAzureStorage({
authType: 'DefaultAzureCredential',
endpoint: 'https://fluent-bundlesize.azurewebsites.net/api/fluentuilatest',
tableName: 'fluentuilatest',
}),
bundler: webpackBundler(config => {
config.externals = config.externals ?? {};
config.externals = {
react: 'React',
'react/jsx-runtime': 'jsxRuntime',
'react-dom': 'ReactDOM',
'react/compiler-runtime': 'ReactCompilerRuntime',
};
return config;
}),
reportResolvers: {
packageName: async packageRoot => {
const packageJson = await fs.promises.readFile(path.join(packageRoot, 'package.json'), 'utf-8');
const json = JSON.parse(packageJson);
return json.name.replace('@fluentui/', '');
},
},
};
export default config;