[Experimental] Only consider files within plugins (#12943)
I have a plugin with a src folder structure following jest’s recommended practice of including a `__tests__` folder: ``` $ find src/ src/ src/document-html-props-server.ts src/__tests__ src/__tests__/document-html-props-server.unit.ts ``` collect-plugins.ts [reads the src directory](https://github.com/zeit/next.js/blob/960c18da53af89115c7e96dc8188646a51c53c15/packages/next/build/plugins/collect-plugins.ts#L65) and finds: ```js [ '__tests__', 'document-html-props-server.ts' ] ``` …which it then [converts to](https://github.com/zeit/next.js/blob/960c18da53af89115c7e96dc8188646a51c53c15/packages/next/build/plugins/collect-plugins.ts#L76-L80): ```js [ '', 'document-html-props-server' ] ``` …and finally [outputs](https://github.com/zeit/next.js/blob/960c18da53af89115c7e96dc8188646a51c53c15/packages/next/build/plugins/collect-plugins.ts#L90-L96): ``` Next.js Plugin: {my plugin} listed invalid middleware ``` This pull request makes collect-plugins.ts only consider files, so my __tests__ directory and its contents are ignored.
Showing
Please
register
or
sign in
to comment