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

Trouble shooting page is vague #580

Open
whamsicore opened this issue Apr 12, 2021 · 1 comment
Open

Trouble shooting page is vague #580

whamsicore opened this issue Apr 12, 2021 · 1 comment

Comments

@whamsicore
Copy link

On the troubleshoot page I'm told to "Set mode to development in chainWebpack to activate warnings: "Set mode to development in chainWebpack to activate warnings"

chainWebpack (config) {
config.mode('development')
}

How do I do this? Where is this file located? Please be more specific!

@TerabyteTiger
Copy link
Member

You can add this to the module.exports in gridsome.server.js - https://gridsome.org/docs/server-api/#apichainwebpackfn

Adding this to the base file would look like:

module.exports = function(api) {
  api.loadSource(({ addCollection }) => {
    // Use the Data Store API here: https://gridsome.org/docs/data-store-api/
  });

  api.createPages(({ createPage }) => {
    // Use the Pages API here: https://gridsome.org/docs/pages-api/
  });

  api.chainWebpack((config) => {
    config.mode("development");
  });
};

If you'd like to submit a PR to update the troubleshooting page to be a bit more clear, it'd be greatly appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants