diff --git a/package.json b/package.json index 6b9cdb8..4e9b0e0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "license": "ISC", "exports": "./src/index.js", "main": "src/index.js", - "type": "module", "scripts": { "format": "prettier --write --ignore-unknown '**/*'" }, diff --git a/src/index.js b/src/index.js index b3cff90..44e733b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ -import babel from '@babel/core'; -import fs from 'fs'; -import path from 'path'; +const babel = require('@babel/core'); +const fs = require('fs'); +const path = require('path'); const pluginBabel = (options = {}) => ({ name: 'babel', @@ -16,7 +16,7 @@ const pluginBabel = (options = {}) => ({ supportsStaticESM: true } }); - if (!babelOptions) return { contents }; + if (!babelOptions) return; if (babelOptions.sourceMaps) { const filename = path.relative(process.cwd(), args.path); @@ -41,4 +41,4 @@ const pluginBabel = (options = {}) => ({ } }); -export default pluginBabel; +module.exports = pluginBabel;