@weco/next-plugin-transpile-modules
Advanced tools
Comparing version 2.2.0 to 2.2.1
26
index.js
@@ -48,14 +48,16 @@ const path = require('path'); | ||
config.externals = config.externals.map(external => { | ||
if (typeof external !== 'function') return external; | ||
return (ctx, req, cb) => { | ||
return includes.find(include => | ||
req.startsWith('.') | ||
? include.test(path.resolve(ctx, req)) | ||
: include.test(req) | ||
) | ||
? cb() | ||
: external(ctx, req, cb); | ||
}; | ||
}); | ||
if(Array.isArray(config.externals)) { | ||
config.externals = config.externals.map(external => { | ||
if (typeof external !== 'function') return external; | ||
return (ctx, req, cb) => { | ||
return includes.find(include => | ||
req.startsWith('.') | ||
? include.test(path.resolve(ctx, req)) | ||
: include.test(req) | ||
) | ||
? cb() | ||
: external(ctx, req, cb); | ||
}; | ||
}); | ||
} | ||
@@ -62,0 +64,0 @@ // Add a rule to include and parse all modules |
{ | ||
"name": "@weco/next-plugin-transpile-modules", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -16,3 +16,3 @@ # Next.js + Transpile `node_modules` | ||
``` | ||
npm install --save @weco/next--plugin-transpile-modules | ||
npm install --save @weco/next-plugin-transpile-modules | ||
``` | ||
@@ -23,3 +23,3 @@ | ||
``` | ||
yarn add @weco/next--plugin-transpile-modules | ||
yarn add @weco/next-plugin-transpile-modules | ||
``` | ||
@@ -26,0 +26,0 @@ |
9473
81