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.

ES6 Modules, Rollup, and Babel

See original GitHub issue

This is an issue for tracking the conversion of source to ES6 Modules along with a Rollup routine and Babel plug-in. In doing so, there are some methods mentioned in code that were to be moved between modules (e.g., some path modules in svgcanvas); these should be moved as well.

Additional ES6 refactoring could then be applied to source as well, such as ES6 classes.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
PatrickMennencommented, May 29, 2018

@brettz9 thanks, that solution works, however it would be nice if there was a named export to SVGCanvas in svgeditor.js (you are already importing it anyways 😉) so that we can at least use the package directly from the node modules without hardlinking to it (or copying it)

Something like: import { Canvas } from ‘svg-edit’

1reaction
PatrickMennencommented, May 28, 2018

Currently it does not seem to be possible to import just the SVGCanvas from the library. It seems there is no export in svg-editor.js which is the main library in your package.json

I know that the component is most probably used as is, but currently I am working on a custom implementation and it would be nice if such an export was available

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Build and Publish ES6 Modules Today, with Babel and ...
From that “dist” folder you will publish your NPM library containing CommonJS, ES6 and UMD bundles compiled with Babel and Rollup. The “package.json”...
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Rollup is a next-generation JavaScript module bundler. Author your app or library using ES2015 modules, then efficiently bundle them up into a single...
Read more >
@rollup/plugin-babel - npm
Seamless integration between Rollup and Babel.. Latest version: 6.0.3, last published: a month ago. Start using @rollup/plugin-babel in your ...
Read more >
rollup-plugin-babel - GitHub
If you're using Babel to transpile your ES6/7 code and Rollup to generate a standalone bundle, you have a couple of options: run...
Read more >
rollup.js
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library...
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