-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodern.config.ts
58 lines (57 loc) · 1.25 KB
/
modern.config.ts
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
import { appTools, defineConfig } from '@modern-js/app-tools';
// https://modernjs.dev/en/configure/app/usage
export default defineConfig({
runtime: {
router: true,
},
source: {
globalVars: {
__APP_NAME__: process.env.npm_package_name,
__APP_VERSION__: process.env.npm_package_version,
__APP_REPOSITORY__: process.env.npm_package_repository,
},
},
plugins: [
appTools({
bundler: 'webpack', // Set to 'experimental-rspack' to enable rspack ⚡️🦀
}),
],
server: {
port: 3000,
},
tools: {
webpack: {
resolve: {
fallback: {
http: false,
https: false,
},
},
module: {
rules: [
// mdx
{
test: /\.mdx?$/,
use: [
{
loader: '@mdx-js/loader',
/** @type {import('@mdx-js/loader').Options} */
options: {
/* jsxImportSource: …, otherOptions… */
},
},
],
},
],
},
},
},
output: {
polyfill: 'usage',
disableNodePolyfill: false,
disableSourceMap: process.env.NODE_ENV === 'production',
},
performance: {
transformLodash: false,
},
});