mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
15 lines
380 B
JavaScript
15 lines
380 B
JavaScript
const reactRefreshPlugin = Npm.require('react-refresh/babel');
|
|
|
|
Plugin.registerCompiler({
|
|
extensions: ['js', 'jsx', 'mjs'],
|
|
}, function () {
|
|
return new BabelCompiler({
|
|
react: true
|
|
}, (babelOptions, file) => {
|
|
if (file.hmrAvailable()) {
|
|
babelOptions.plugins = babelOptions.plugins || []
|
|
babelOptions.plugins.push(reactRefreshPlugin)
|
|
}
|
|
});
|
|
});
|