Skip to content

Commit

Permalink
fix: mini-css-plugin location
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jan 14, 2022
1 parent c63b339 commit b4ac0f1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions integrations/gatsby-theme-stories/src/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import {
} from 'gatsby';
import { getRoutes } from '@component-controls/routes';

const miniCss = (): string => {
try {
return require.resolve('gatsby/node_modules/mini-css-extract-plugin');
} catch {
return require.resolve('mini-css-extract-plugin');
}
};
export const createPagesStatefully = async (
{ actions, store: gatsbyStore }: CreatePagesArgs,
options: BuildProps,
Expand All @@ -37,9 +44,7 @@ export const createPagesStatefully = async (
loaders: {
...options?.loaders,
'mini-css-extract-plugin': {
module: require.resolve(
'gatsby/node_modules/mini-css-extract-plugin',
),
module: miniCss(),
},
},
},
Expand Down

0 comments on commit b4ac0f1

Please sign in to comment.