Skip to content

Commit

Permalink
add chai to default esinstall namedExports list
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Oct 3, 2020
1 parent a5cb5f5 commit 86f1c16
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions esinstall/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const CJS_PACKAGES_TO_AUTO_DETECT = [
'prop-types/index.js',
'scheduler/index.js',
'react-table',
'chai/index.js'
];

// Rarely, a package will ship a broken "browser" package.json entrypoint.
Expand Down Expand Up @@ -347,7 +348,6 @@ ${colors.dim(
}

await initESModuleLexer;
let isCircularImportFound = false;
let isFatalWarningFound = false;
const inputOptions: InputOptions = {
input: installEntrypoints,
Expand Down Expand Up @@ -392,14 +392,6 @@ ${colors.dim(
rollupPluginStripSourceMapping(),
].filter(Boolean) as Plugin[],
onwarn(warning) {
// Warn about the first circular dependency, but then ignore the rest.
if (warning.code === 'CIRCULAR_DEPENDENCY') {
if (!isCircularImportFound) {
isCircularImportFound = true;
logger.warn(`Warning: 1+ circular dependencies found via "${warning.importer}".`);
}
return;
}
// Log "unresolved" import warnings as an error, causing Snowpack to fail at the end.
if (
warning.code === 'PLUGIN_WARNING' &&
Expand All @@ -416,10 +408,12 @@ ${colors.dim(
return;
}
const {loc, message} = warning;
if (loc) {
logger.warn(`${loc.file}:${loc.line}:${loc.column} ${message}`);
} else {
logger.warn(message);
const logMessage = loc ? `${loc.file}:${loc.line}:${loc.column} ${message}` : message;
// These two warnings are usually harmless in packages, so don't show them by default.
if (warning.code === 'CIRCULAR_DEPENDENCY' || warning.code === 'NAMESPACE_CONFLICT') {
logger.debug(logMessage);
} else {
logger.warn(logMessage);
}
},
};
Expand Down

1 comment on commit 86f1c16

@vercel
Copy link

@vercel vercel bot commented on 86f1c16 Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.