Skip to content

Commit

Permalink
fix: node8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushong committed Dec 6, 2019
1 parent 29c7485 commit 57a71df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ try {
importESM = require('./import');
} catch (err) {
debug('failed to load esm import: ', err);
importESM = () => Promise.reject(err);
importESM = () => Promise.reject(new Error('Not supported'));
}

exports.importESM = importESM;
Expand Down
1 change: 1 addition & 0 deletions lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class Project {
* @returns {T}
*/
require(id) {
debug('require', id);
return this.app.require(id);
}

Expand Down
2 changes: 2 additions & 0 deletions test/project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module.exports = 'from lib1';
`,
};
if (await supportsESM()) {
// eslint-disable-next-line no-console
console.log(' [esm support enabled]');
files['modules/mod1/everywhere.mjs'] = `\
export default 'from mod1';
export const namedExport = 'forwarded';
Expand Down

0 comments on commit 57a71df

Please sign in to comment.