Skip to content

Commit

Permalink
test: retry
Browse files Browse the repository at this point in the history
  • Loading branch information
TrickyPi committed May 28, 2023
1 parent 2ba075e commit f1cbd30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/commonjs/src/index.js
Expand Up @@ -140,15 +140,15 @@ export default function commonjs(options = {}) {
!isEsModule && (dynamicRequireModules.has(normalizedId) || strictRequiresFilter(id));

const checkDynamicRequire = (position) => {
const normalizedRequireRoot = normalizePathSlashes(dynamicRequireRoot);
const normalizedDynamicRequireRoot = normalizePathSlashes(dynamicRequireRoot);

if (normalizedId.indexOf(normalizedRequireRoot) !== 0) {
if (normalizedId.indexOf(normalizedDynamicRequireRoot) !== 0) {
this.error(
{
code: 'DYNAMIC_REQUIRE_OUTSIDE_ROOT',
normalizedId,
dynamicRequireRoot,
message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedRequireRoot}". You should set dynamicRequireRoot to "${dirname(
normalizedDynamicRequireRoot,
message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedDynamicRequireRoot}". You should set dynamicRequireRoot to "${dirname(
normalizedId
)}" or one of its parent directories.`
},
Expand Down
4 changes: 2 additions & 2 deletions packages/commonjs/test/test.js
Expand Up @@ -733,8 +733,8 @@ test('throws when there is a dynamic require from outside dynamicRequireRoot', a
t.like(error, {
message: `"${id}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${dynamicRequireRoot}". You should set dynamicRequireRoot to "${minimalDynamicRequireRoot}" or one of its parent directories.`,
pluginCode: 'DYNAMIC_REQUIRE_OUTSIDE_ROOT',
id,
dynamicRequireRoot
normalizedId: id,
normalizedDynamicRequireRoot: dynamicRequireRoot
});
});

Expand Down

0 comments on commit f1cbd30

Please sign in to comment.