-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
_config.js
17 lines (16 loc) · 870 Bytes
/
_config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const { assertIncludes } = require('../../../utils.js');
module.exports = {
description: 'provides a helpful error message if a transpiled config is interpreted as "module"',
minNodeVersion: 13,
command: 'rollup -c',
error: () => true,
stderr: stderr =>
assertIncludes(
stderr,
'[!] Error: 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'
)
};