Coder Social home page Coder Social logo

gen-esm-wrapper's People

Contributors

addaleax avatar bjornstar avatar guybedford avatar jawj avatar schwarzkopfb avatar zyszys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gen-esm-wrapper's Issues

A few questions

Hello @addaleax

I'm using gen-esm-wrapper to bundle a library I develop so firstly thanks for your work ๐Ÿ‘

A recent issue raised some questions regarding how gen-esm-wrapper works specifically in regards to default import/exports.

For the example code:

'use strict';
// This is a CommonJS module.

exports.method = () => {
  return 'hello';
};

The wrapped esm version would be:

import mod from "../index.js";

export default mod;
export const method = mod.method;

The questions are:

  1. How does the default import import mod from "../index.js"; work considering the input has no default export.
  2. Why does the output adds a default export even though the input did not have one?
    • Does not this mean a user of a library may have slightly different APIs exposed if they are using the the ESM or the CJS version?

I am probably missing some basic piece of information here, any help would be appreciated ๐Ÿ˜„

Thanks.
Shahar.

Command doesn't finished

Node.js: 16.13.0
npm: 8.1.3

In my package.json

"scripts": {
  ...
  "build": "gen-esm-wrapper dist/index.js dist/index.mjs",
  ...
}

and when I use command npm run build then command doesn't finished.
image
So I shoude be use Ctrl+C to exit command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.