Files
30-seconds-of-code/node_modules/gatsby/dist/internal-plugins/webpack-theme-component-shadowing/gatsby-node.js
2019-08-20 15:52:05 +02:00

30 lines
646 B
JavaScript

"use strict";
const GatsbyThemeComponentShadowingResolverPlugin = require(`.`);
exports.onCreateWebpackConfig = ({
store,
stage,
getConfig,
rules,
loaders,
actions
}, pluginOptions) => {
const {
themes,
flattenedPlugins
} = store.getState();
actions.setWebpackConfig({
resolve: {
plugins: [new GatsbyThemeComponentShadowingResolverPlugin({
themes: themes.themes ? themes.themes : flattenedPlugins.map(plugin => {
return {
themeDir: plugin.pluginFilepath,
themeName: plugin.name
};
})
})]
}
});
};
//# sourceMappingURL=gatsby-node.js.map