Skip to content
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

fix(gatsby): compile themes through default webpack config #13651

Merged
merged 12 commits into from
May 14, 2019
Merged
13 changes: 13 additions & 0 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ module.exports = async (
rules.media(),
rules.miscAssets(),
]
if (
store.getState().themes.themes
) {
configRules.concat(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one probably needs to be

configRules = configRules.concat...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, true as concat would not alter the original array

store.getState().themes.themes.map(theme => {
return {
test: /\.jsx?$/,
includes: theme.themeDir,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think the rule option is called include vs includes

https://webpack.js.org/configuration/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, good catch

use: [loaders.js()],
}
})
)
}
switch (stage) {
case `develop`: {
// get schema to pass to eslint config and program for directory
Expand Down