Skip to content

Commit

Permalink
Handle backslashes for plugins (vercel#9282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored and Timer committed Nov 2, 2019
1 parent d21ad2b commit 739322d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/plugins/collect-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function collectPluginMeta(

return {
middleware,
directory: pkgDir,
directory: pkgDir.replace(/\\/g, '/'),
requiredEnv: pluginMetaData['required-env'],
version: pluginPackageJson.version,
pluginName: pluginMetaData.name,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default async function getBaseWebpackConfig(
/next[\\/]dist[\\/]pages/,
/[\\/](strip-ansi|ansi-regex)[\\/]/,
...(config.experimental.plugins
? VALID_MIDDLEWARE.map(name => new RegExp(`src/${name}`))
? VALID_MIDDLEWARE.map(name => new RegExp(`src(\\\\|/)${name}`))
: []),
]

Expand Down

0 comments on commit 739322d

Please sign in to comment.