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

OPTIMIZATION: Scan filesystem for which webpack loaders to add to lower startup time #144

Closed
KyleAMathews opened this issue Feb 25, 2016 · 2 comments

Comments

@KyleAMathews
Copy link
Contributor

There was a noticeable slowdown in Gatsby 0.8 from 0.7 due mostly (I'm assuming) from the addition of several new Webpack loaders. This slowdown will only increase as more file-types get out-of-the-box support. To keep things speedy, it might work well to scan the pages directory on startup for which file extensions are there and then use that to choose which loaders to use.

@KyleAMathews KyleAMathews changed the title Scan filesystem for which webpack loaders to add FEATURE: Scan filesystem for which webpack loaders to add to lower startup time Feb 26, 2016
@KyleAMathews KyleAMathews changed the title FEATURE: Scan filesystem for which webpack loaders to add to lower startup time OPTIMIZATION: Scan filesystem for which webpack loaders to add to lower startup time Feb 26, 2016
@dvonlehman
Copy link
Contributor

Along these lines I would suggest not taking on a dependency to node-sass, postcss, less, etc. The dependency tree for a stock install of gatsby is quite big leading to long install times. In webpack.config.js, common file extensions could still be preconfigured, but detect if the required loader is present in node_modules. If not, emit an error informing the user they need to install the necessary webpack loader to their own project. That way users of less don't have to incur the overhead of installing postcss and sass.

@KyleAMathews
Copy link
Contributor Author

@dvonlehman thanks for the thoughts! My plan atm is to introduce a plugin system so all these options would be moved there and only added if you want sass or less, etc. I'll be posting an RFC once I can find enough time to pull that together.

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