Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59636d7
commit d2ba3e6
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
const { assertStderrIncludes } = require('../../../utils.js'); | ||
|
||
module.exports = { | ||
description: 'provides a helpful error message if a transpiled config is interpreted as "module"', | ||
command: 'cd sub && rollup -c' | ||
minNodeVersion: 13, | ||
command: 'cd sub && rollup -c', | ||
error: () => true, | ||
stderr: stderr => | ||
assertStderrIncludes( | ||
stderr, | ||
'[!] While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS ' + | ||
'file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can ' + | ||
'try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will ' + | ||
'prevent Rollup from trying to preprocess the file but rather hand it to Node directly.\n' + | ||
'https://rollupjs.org/guide/en/#using-untranspiled-config-files' | ||
) | ||
}; |