Closed ryancat closed 5 years ago
Mixing require
with ESMs in TypeScript is a recipe for confusion and should be avoided. Rollup doesn't know anything about require
being a thing as far as I know. I believe if you used dynamic import (import('./util_es5')
, note this returns a promise) or ESM import (import * as util from "util"
) things should work properly. Feel free to re-open if this is not the case!
This plugin is not bundling commonjs module anymore if I have typescript code that tries to import a commonjs module.
Here is the config:
The output simply includes
var util = require('./util_es5');
, which will causing errors asutil_es5.js
is not in the dist folder.