Coder Social home page Coder Social logo

ES6 import about micromodal HOT 5 CLOSED

nlemoine avatar nlemoine commented on May 17, 2024
ES6 import

from micromodal.

Comments (5)

ghosh avatar ghosh commented on May 17, 2024

@nlemoine Hey, I'm not sure if that would be possible as we have to maintain compatibility with ES6 as well.

You can use a babel transform with your Browserify. This should help you out - https://github.com/babel/babelify

Closing this for now, as ES6 imports already work. Feel free to let know if you face difficulties.

from micromodal.

nlemoine avatar nlemoine commented on May 17, 2024

Thanks for your feedback.

I'm already using babelify (my project code is ES6) but I'm having the same issue described here: babel/babelify#247
Maybe a babelify issue but I'm wondering how this can work as babelify presets aren't always the same across projects (using global: true results in a error saying Couldn't find preset "latest"). See last comment here: babel/babelify#215 (comment)

I think you can keep your original code in ES6 and provide multiple versions allowing developers to select the one depending on their environment. See: https://medium.com/@tarkus/how-to-build-and-publish-es6-modules-today-with-babel-and-rollup-4426d9c7ca71

Anyway, I fixed my issue for now using the dist version: import micromodal from 'micromodal/dist/micromodal'

from micromodal.

nlemoine avatar nlemoine commented on May 17, 2024

@ghosh Please see: https://github.com/rollup/rollup-plugin-babel#external-dependencies

Would you consider reopening the issue?

from micromodal.

ghosh avatar ghosh commented on May 17, 2024

@nlemoine Thanks for the update and the relevant documentation.

Will look into it.

from micromodal.

nlemoine avatar nlemoine commented on May 17, 2024

Thanks for considering the request! 👍

from micromodal.

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.