question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

disable __esModule

See original GitHub issue

how to disable__esModule? just like

Object.defineProperty(exports, "__esModule", {
  value: true
});
i don't want it in nodejs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
luo-gengcommented, Jan 11, 2019
["@babel/plugin-transform-modules-commonjs", {
       strict: true
     }]
0reactions
deadmanncommented, Mar 3, 2021

I wish I could remove it an flatten my codes 😐

First I wrote JS helpers, then turn them to TS, then moved to angularJS 1.6, then changed them for angular 7, then changed them for react, now again I wish to use them with browser JS, and it gives me trouble, why TS can’t do a simple thing in a simple way. 😐 now I can only export for AMD and SystemJS, which both require ‘require’ which both, I have trouble with, and it also rely on another package which by default is not provided. otherwise I get tons of files 😐

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable generate "exports.__esModule = true;"
The exports.__esModule and require('lib') are what happen when we transpile from an ES module to commonjs (with babel or with TypeScript).
Read more >
Option to disable __esModule? · Issue #708 · rollup ... - GitHub
I've made this plugin to remove __esModule line, when want to compatible with ES3: https://github.com/futurist/rollup-plugin-es3 ...
Read more >
TSConfig Option: esModuleInterop - TypeScript
With esModuleInterop disabled: ts. "use strict";. Object.defineProperty(exports, "__esModule", { value: true });. const fs = require("fs");.
Read more >
Options - Babel.js
When the esmodules target is specified, it will intersect with the browsers ... to explicitly disable Babel compilation of files inside the lib...
Read more >
Using the Node.js agent in an ES module application
New Relic for Node.js is disabled due to an error: Error [ERR_REQUIRE_ESM]: require() of ES module /path/to/your/application/newrelic.js from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found