Coder Social home page Coder Social logo

Comments (4)

sebmck avatar sebmck commented on May 10, 2024

Actually as of babel/babel#379 the AMD/UMD module formatter exports directly with defaults. 6to5 was going to add support for globals (see babel/babel#119 (comment)) but there were various issues associated with it.

from website.

tomek-he-him avatar tomek-he-him commented on May 10, 2024

Alright, now looking at your tests it seems like I have picked up something you had been working on in parallel. Bad luck :)

BTW, it's a lot cleaner than my solution. Impressive how quickly 6to5 develops. Thumbs up!

from website.

sebmck avatar sebmck commented on May 10, 2024

Thanks for your work though @tomekwi! I'll check out your globals stuff as I haven't currently implemented that and I'd be interested to see how it works.

from website.

tomek-he-him avatar tomek-he-him commented on May 10, 2024

@sebmck, I've simply chosen to name the export/import after the filename. This approach isn't explicit, but works out of the box – also when you have mutiple modules in your app.

When you need to import a library by another name, you use the syntax import _ from "lodash". I think it's quite natural, just as import $ from "jquery" or import m from "mithril" anyway.

You can still import {default as _} from "lodash" if you really want the global.lodash.

from website.

Related Issues (20)

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.