Skip to content

Commit e16fa64

Browse files
committed
Remove esm usage
1 parent 8c38791 commit e16fa64

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/load_brocfile.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import path from 'path';
22
import findup from 'findup-sync';
3-
import esm from 'esm';
4-
5-
const esmRequire = esm(module);
63

74
interface LoadBrocfileOptions {
85
brocfilePath?: string;
@@ -37,8 +34,7 @@ function requireBrocfile(brocfilePath: string) {
3734
// Load brocfile via ts-node
3835
brocfile = require(brocfilePath);
3936
} else {
40-
// Load brocfile via esm shim
41-
brocfile = esmRequire(brocfilePath);
37+
brocfile = require(brocfilePath);
4238
}
4339

4440
// ESM `export default X` is represented as module.exports = { default: X }

test/load_brocfile_test.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import loadBrocfile from '../lib/load_brocfile';
22
import BroccoliSource from 'broccoli-source';
33
import chai from 'chai';
4-
import esm from 'esm';
5-
6-
const esmRequire = esm(module);
74

85
const projectPath = 'test/fixtures/project';
96
const projectPathEsm = 'test/fixtures/project-esm';
@@ -13,7 +10,7 @@ const projectPathTsConfig = 'test/fixtures/project-ts-tsconfig';
1310
const brocfileFixture = require('../' + projectPath + '/Brocfile.js');
1411
// eslint-disable-next-line @typescript-eslint/no-var-requires
1512
const brocfileFunctionFixture = require('../' + projectPath + '/Brocfile-Function.js');
16-
const brocfileEsmFixture = esmRequire('../' + projectPathEsm + '/Brocfile.js');
13+
const brocfileEsmFixture = require('../' + projectPathEsm + '/Brocfile.js');
1714

1815
describe('loadBrocfile', function() {
1916
let oldCwd = null;

0 commit comments

Comments
 (0)