@nx/gatsby
Version:
Gatsby Plugin for Nx
26 lines • 761 B
JavaScript
/*
* Babel preset to provide Gatsby support for Nx.
*/
module.exports = function (api, presetOptions) {
api.assertVersion(7);
return {
presets: [
'@nx/web/babel',
[
require.resolve('babel-preset-gatsby'),
getGatsbyBabelOptions({ presetOptions }),
],
],
};
};
function getGatsbyBabelOptions({ presetOptions }) {
var _a;
const gatsbyPresetOptions = {
reactRuntime: (_a = presetOptions.reactRuntime) !== null && _a !== void 0 ? _a : 'automatic',
};
if (presetOptions.reactImportSource) {
gatsbyPresetOptions.reactImportSource = presetOptions.reactImportSource;
}
return gatsbyPresetOptions;
}
//# sourceMappingURL=babel.js.map