Skip to content

Commit 2b73ec9

Browse files
chore: Correct Vitest config
Co-authored-by: ShootingStarDragons <ShootingStarDragons@protonmail.com>
1 parent 52a3711 commit 2b73ec9

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

vitest.config.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ const root = path.resolve(__dirname);
1010
const alias = {
1111
'^react$': path.join(
1212
root,
13-
MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js'
13+
MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js'
1414
),
1515
'^react-dom$': path.join(
1616
root,
17-
MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js'
17+
MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js'
1818
),
19-
'^preact$': path.join(root, MINIFY ? 'dist/preact.mjs' : 'src/index.js'),
19+
'^preact$': path.join(root, MINIFY ? 'dist/preact.esm.js' : 'src/index.js'),
2020
'^preact/compat$': path.join(
2121
root,
22-
MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js'
22+
MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js'
2323
),
2424
'^preact/jsx-runtime$': path.join(
2525
root,
26-
MINIFY ? 'jsx-runtime/dist/jsxRuntime.mjs' : 'jsx-runtime/src/index.js'
26+
MINIFY ? 'jsx-runtime/dist/jsxRuntime.esm.js' : 'jsx-runtime/src/index.js'
2727
),
2828
'^preact/jsx-runtime/src$': path.join(
2929
root,
30-
MINIFY ? 'jsx-runtime/dist/jsxRuntime.mjs' : 'jsx-runtime/src'
30+
MINIFY ? 'jsx-runtime/dist/jsxRuntime.esm.js' : 'jsx-runtime/src'
3131
),
3232
'^preact/jsx-dev-runtime$': path.join(
3333
root,
@@ -37,82 +37,82 @@ const alias = {
3737
),
3838
'^preact/debug$': path.join(
3939
root,
40-
MINIFY ? 'debug/dist/debug.mjs' : 'debug/src/index.js'
40+
MINIFY ? 'debug/dist/debug.esm.js' : 'debug/src/index.js'
4141
),
4242
'^preact/devtools$': path.join(
4343
root,
4444
MINIFY ? 'devtools/dist/devtools.js' : 'devtools/src/index.js'
4545
),
4646
'^preact/hooks$': path.join(
4747
root,
48-
MINIFY ? 'hooks/dist/hooks.mjs' : 'hooks/src/index.js'
48+
MINIFY ? 'hooks/dist/hooks.esm.js' : 'hooks/src/index.js'
4949
),
5050
'^preact/test-utils$': path.join(
5151
root,
52-
MINIFY ? 'test-utils/dist/testUtils.mjs' : 'test-utils/src/index.js'
52+
MINIFY ? 'test-utils/dist/testUtils.esm.js' : 'test-utils/src/index.js'
5353
)
5454
};
5555

5656
const rollupAlias = [
5757
{
5858
find: /^react$/,
5959
replacement: MINIFY
60-
? path.join(root, 'compat/dist/compat.mjs')
60+
? path.join(root, 'compat/dist/compat.esm.js')
6161
: path.join(root, 'compat/src/index.js')
6262
},
6363
{
6464
find: /^react-dom$/,
6565
replacement: MINIFY
66-
? path.join(root, 'compat/dist/compat.mjs')
66+
? path.join(root, 'compat/dist/compat.esm.js')
6767
: path.join(root, 'compat/src/index.js')
6868
},
6969
{ find: /^preact$/, replacement: path.join(root, 'src/index.js') },
7070
{
7171
find: /^preact\/compat$/,
7272
replacement: MINIFY
73-
? path.join(root, 'compat/dist/compat.mjs')
73+
? path.join(root, 'compat/dist/compat.esm.js')
7474
: path.join(root, 'compat/src/index.js')
7575
},
7676
{
7777
find: /^preact\/jsx-runtime$/,
7878
replacement: MINIFY
79-
? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs')
79+
? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js')
8080
: path.join(root, 'jsx-runtime/src/index.js')
8181
},
8282
{
8383
find: /^preact\/jsx-runtime\/src$/,
8484
replacement: MINIFY
85-
? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs')
85+
? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js')
8686
: path.join(root, 'jsx-runtime/src')
8787
},
8888
{
8989
find: /^preact\/jsx-dev-runtime$/,
9090
replacement: MINIFY
91-
? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs')
91+
? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js')
9292
: path.join(root, 'jsx-runtime/src/index.js')
9393
},
9494
{
9595
find: /^preact\/debug$/,
9696
replacement: MINIFY
97-
? path.join(root, 'debug/dist/debug.mjs')
97+
? path.join(root, 'debug/dist/debug.esm.js')
9898
: path.join(root, 'debug/src/index.js')
9999
},
100100
{
101101
find: /^preact\/devtools$/,
102102
replacement: MINIFY
103-
? path.join(root, 'devtools/dist/devtools.mjs')
103+
? path.join(root, 'devtools/dist/devtools.esm.js')
104104
: path.join(root, 'devtools/src/index.js')
105105
},
106106
{
107107
find: /^preact\/hooks$/,
108108
replacement: MINIFY
109-
? path.join(root, 'hooks/dist/hooks.mjs')
109+
? path.join(root, 'hooks/dist/hooks.esm.js')
110110
: path.join(root, 'hooks/src/index.js')
111111
},
112112
{
113113
find: /^preact\/test-utils$/,
114114
replacement: MINIFY
115-
? path.join(root, 'test-utils/dist/testUtils.mjs')
115+
? path.join(root, 'test-utils/dist/testUtils.esm.js')
116116
: path.join(root, 'test-utils/src/index.js')
117117
}
118118
];
@@ -201,13 +201,13 @@ export default defineConfig({
201201
enabled: COVERAGE,
202202
include: MINIFY
203203
? [
204-
'dist/preact.mjs',
205-
'compat/dist/compat.mjs',
206-
'devtools/dist/devtools.mjs',
207-
'jsx-runtime/dist/jsxRuntime.mjs',
208-
'debug/dist/debug.mjs',
209-
'hooks/dist/hooks.mjs',
210-
'test-utils/dist/testUtils.mjs'
204+
'dist/preact.esm.js',
205+
'compat/dist/compat.esm.js',
206+
'devtools/dist/devtools.esm.js',
207+
'jsx-runtime/dist/jsxRuntime.esm.js',
208+
'debug/dist/debug.esm.js',
209+
'hooks/dist/hooks.esm.js',
210+
'test-utils/dist/testUtils.esm.js'
211211
]
212212
: [
213213
'src/**/*',

0 commit comments

Comments
 (0)