Skip to content

Commit b33cceb

Browse files
committed
feature #762 fix: preact compat (Grafikart)
This PR was merged into the main branch. Discussion ---------- fix: preact compat With the realease of the version 10 of preact, preact compat was migrated inside preact library removing the need for preact-compat. https://preactjs.com/guide/v10/switching-to-preact/ Commits ------- d48dba1 fix: preact compat
2 parents b2456a9 + d48dba1 commit b33cceb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/config-generator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ class ConfigGenerator {
133133
}
134134

135135
if (this.webpackConfig.usePreact && this.webpackConfig.preactOptions.preactCompat) {
136-
config.resolve.alias['react'] = 'preact-compat';
137-
config.resolve.alias['react-dom'] = 'preact-compat';
136+
config.resolve.alias['react'] = 'preact/compat';
137+
config.resolve.alias['react-dom'] = 'preact/compat';
138138
}
139139

140140
Object.assign(config.resolve.alias, this.webpackConfig.aliases);

test/config-generator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ describe('The config-generator function', () => {
540540
'foo': 'bar',
541541
'vue$': 'new-vue$',
542542
'react-dom': 'new-react-dom',
543-
'react': 'preact-compat' // Keeps predefined aliases that are not overwritten
543+
'react': 'preact/compat' // Keeps predefined aliases that are not overwritten
544544
});
545545
});
546546
});

0 commit comments

Comments
 (0)