From 71d9308f5ab8f8132831bd4af9e91a2e96334ba0 Mon Sep 17 00:00:00 2001 From: atanasster Date: Wed, 9 Dec 2020 21:57:13 -0500 Subject: [PATCH] fix: loading of gatsby-config.js --- integrations/gatsby-theme-stories/gatsby-config.js | 8 +------- integrations/gatsby-theme-stories/package.json | 2 +- integrations/gatsby-theme-stories/rollup.config.js | 7 ++++++- .../gatsby-theme-stories/src/gatsby-config.ts | 12 ++++++++++++ yarn.lock | 8 ++++---- 5 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 integrations/gatsby-theme-stories/src/gatsby-config.ts diff --git a/integrations/gatsby-theme-stories/gatsby-config.js b/integrations/gatsby-theme-stories/gatsby-config.js index 25cd13103..07a3eddb4 100644 --- a/integrations/gatsby-theme-stories/gatsby-config.js +++ b/integrations/gatsby-theme-stories/gatsby-config.js @@ -1,7 +1 @@ -module.exports = () => { - return { - plugins: ['gatsby-plugin-theme-ui', 'gatsby-plugin-typescript'].filter( - Boolean, - ), - }; -}; +module.exports = require('./dist/gatsby-config'); diff --git a/integrations/gatsby-theme-stories/package.json b/integrations/gatsby-theme-stories/package.json index 3263d8d7c..ea5cdfa46 100644 --- a/integrations/gatsby-theme-stories/package.json +++ b/integrations/gatsby-theme-stories/package.json @@ -43,7 +43,7 @@ "@component-controls/pages": "^2.2.1", "@component-controls/webpack-compile": "^2.2.1", "@component-controls/webpack-configs": "^2.2.1", - "gatsby-plugin-theme-ui": "^0.3.0", + "gatsby-plugin-theme-ui": "^0.6.0-alpha.3", "gatsby-plugin-typescript": "^2.4.24", "react-helmet": "^6.0.0", "theme-ui": "^0.6.0-alpha.3" diff --git a/integrations/gatsby-theme-stories/rollup.config.js b/integrations/gatsby-theme-stories/rollup.config.js index c73a4f121..f1ed9882b 100644 --- a/integrations/gatsby-theme-stories/rollup.config.js +++ b/integrations/gatsby-theme-stories/rollup.config.js @@ -1,5 +1,10 @@ import { config } from '../../rollup-config'; export default config({ - input: ['./src/index.ts', './src/gatsby-node.ts', './src/gatsby-ssr.tsx'], + input: [ + './src/index.ts', + './src/gatsby-node.ts', + './src/gatsby-config.ts', + './src/gatsby-ssr.tsx', + ], }); diff --git a/integrations/gatsby-theme-stories/src/gatsby-config.ts b/integrations/gatsby-theme-stories/src/gatsby-config.ts new file mode 100644 index 000000000..436c44702 --- /dev/null +++ b/integrations/gatsby-theme-stories/src/gatsby-config.ts @@ -0,0 +1,12 @@ +import { theme } from '@component-controls/components'; +module.exports = (): any => ({ + plugins: [ + { + resolve: 'gatsby-plugin-theme-ui', + options: { + preset: theme, + }, + }, + 'gatsby-plugin-typescript', + ], +}); diff --git a/yarn.lock b/yarn.lock index 31a1c64ba..ce2565438 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12923,10 +12923,10 @@ gatsby-plugin-root-import@^2.0.5: resolved "https://registry.yarnpkg.com/gatsby-plugin-root-import/-/gatsby-plugin-root-import-2.0.5.tgz#04e520dc661d67f49aa7950f11b7c780fd2fdbd3" integrity sha512-/yA6rFjfjiFb8D6nCjfFrrGqYQMkOt4J3u2o6s7VYEF/zpA5dw2C9ENJ5fDKkJSCbbwLiEIGVMMee3vMEip2zA== -gatsby-plugin-theme-ui@^0.3.0: - version "0.3.4" - resolved "https://registry.yarnpkg.com/gatsby-plugin-theme-ui/-/gatsby-plugin-theme-ui-0.3.4.tgz#b3ed23b847c9667a7b54f2f3549a02582e34b633" - integrity sha512-Jz3Z+LHkYJvKTotuibfKy5JgN74VuDYMphMk/dWe4P4AY/4MmJh9YN7Uvkr3J0hZc32x8E9m8YgbSDb3M53HsA== +gatsby-plugin-theme-ui@^0.6.0-alpha.3: + version "0.6.0-alpha.3" + resolved "https://registry.yarnpkg.com/gatsby-plugin-theme-ui/-/gatsby-plugin-theme-ui-0.6.0-alpha.3.tgz#68f9c17e72fd655ad4eee94eeabb1bcf9bbbddad" + integrity sha512-ZwGoa5YRanrQfEc/8Zm1O7Knrz5YwcBLVintCu5tOowDpgFrb7irJGLFL+jEauOatiKN2ybzF/PsDx45gOTY0A== gatsby-plugin-typescript@^2.1.6, gatsby-plugin-typescript@^2.4.24: version "2.4.24"