-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-plugin-theme-ui, add path option #1355
Comments
Thanks @atanasster But starting next year, I will be using Theme UI more intensively and should be able to bring more people to help on this project 🎉 |
wow, thats great hear, what kind of projects are you doing with theme-ui? I will file a PR on this one - since you are finding a lot of great bugs and new features - just let me know anytime you prefer to file a PR yoursel |
Hi @fcisio I looked a bit closer and remembered that you can actually pass the theme object as an option to the plugin - you just need to in gatsby-config.js :
Since gatsby-config does not support es6 modules you will need to module.export the theme
Would this work for you? |
Oh amazing @atanasster. Maybe we should add an example like that to https://theme-ui.com/packages/gatsby-plugin? |
Thanks @lachlanjc - I sent a PR, can you please check the text : https://theme-ui-gr3r68aaa.vercel.app/packages/gatsby-plugin |
You could also use babel-register or ts-node. const sourceMapSupport = require("source-map-support");
const tsNode = require("ts-node");
let registered = false;
module.exports = function registerTsNode() {
if (registered) {
return;
}
registered = true;
sourceMapSupport.install();
tsNode.register({
compilerOptions: {
module: "commonjs",
target: "es2017",
// TS_NODE_FILES is set to false, so declarations.d.ts are not loaded
noImplicitAny: false,
project: "../../../tsconfig.json",
},
});
};
module.exports = require("./gatsby-config.ts"); https://github.com/hasparus/homepage/blob/master/gatsby-config.js |
Yeah, couple of workarounds. |
Is your feature request related to a problem? Please describe.
Not a problem, but it would be nice to be able to specify the theme path with an option.
The default path is
src/gatsby-plugin-theme-ui/index.js
Describe the solution you'd like
Something like:
The text was updated successfully, but these errors were encountered: