Skip to content

Commit

Permalink
Remove esm usage
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jun 3, 2022
1 parent 8c38791 commit e16fa64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions lib/load_brocfile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import path from 'path';
import findup from 'findup-sync';
import esm from 'esm';

const esmRequire = esm(module);

interface LoadBrocfileOptions {
brocfilePath?: string;
Expand Down Expand Up @@ -37,8 +34,7 @@ function requireBrocfile(brocfilePath: string) {
// Load brocfile via ts-node
brocfile = require(brocfilePath);
} else {
// Load brocfile via esm shim
brocfile = esmRequire(brocfilePath);
brocfile = require(brocfilePath);
}

// ESM `export default X` is represented as module.exports = { default: X }
Expand Down
5 changes: 1 addition & 4 deletions test/load_brocfile_test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import loadBrocfile from '../lib/load_brocfile';
import BroccoliSource from 'broccoli-source';
import chai from 'chai';
import esm from 'esm';

const esmRequire = esm(module);

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

describe('loadBrocfile', function() {
let oldCwd = null;
Expand Down

0 comments on commit e16fa64

Please sign in to comment.