$ cnpm install @putout/plugin-convert-esm-to-commonjs
EcmaScript module syntax is the standard way to import and export values between files in JavaScript. The
importstatement can be used to reference a value exposed by theexportstatement in another file.CommonJS is a module system supported in Node, it provides a
requirefunction, which can be used to access theexportsobject exposed by another file.(c) parceljs
????Putout plugin adds ability to convert EcmaScript Modules to CommonJS. Use @putout/plugin-nodejs instead.
npm i @putout/plugin-convert-esm-to-commonjs
{
"rules": {
"convert-esm-to-commonjs": "on"
}
}
import hello from 'world';
const hello = require('world');
MIT
Copyright 2013 - present © cnpmjs.org | Home |