Skip to content

Commit

Permalink
chore(gatsby-theme-stories): load gatsby mini-css-extract-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jan 13, 2022
1 parent 997abdb commit ca66214
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/webpack-configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"file-loader": "^6.2.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"mini-css-extract-plugin": "1.6.2",
"mini-css-extract-plugin": "^2.4.6",
"path": "^0.12.7",
"postcss-loader": "^6.2.1",
"raw-loader": "^4.0.2",
Expand Down
12 changes: 11 additions & 1 deletion integrations/gatsby-theme-stories/src/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ export const createPagesStatefully = async (
createPage(props);
};
await buildBundle({
options,
options: {
...options,
loaders: {
...options?.loaders,
'mini-css-extract-plugin': {
module: require.resolve(
'gatsby/node_modules/mini-css-extract-plugin',
),
},
},
},
onEndBuild: ({ store }) => {
const routes = getRoutes(store);
routes.forEach(({ path, ...route }) => {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14540,6 +14540,13 @@ [email protected]:
schema-utils "^3.0.0"
webpack-sources "^1.1.0"

mini-css-extract-plugin@^2.4.6:
version "2.4.6"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.4.6.tgz#0f925aaa02dd26513bac40802062a87ebe32e7cc"
integrity sha512-khHpc29bdsE9EQiGSLqQieLyMbGca+bkC42/BBL1gXC8yAS0nHpOTUCBYUK6En1FuRdfE9wKXhGtsab8vmsugg==
dependencies:
schema-utils "^4.0.0"

mini-svg-data-uri@^1.2.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/mini-svg-data-uri/-/mini-svg-data-uri-1.4.3.tgz#43177b2e93766ba338931a3e2a84a3dfd3a222b8"
Expand Down

0 comments on commit ca66214

Please sign in to comment.