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.

Distribution in ES6 modules format

See original GitHub issue

The project website and npm page (in usage examples) suggests that the package is distributed in es6 module format, but that doesn’t seem to be the case. Doing npm install --save ttag and putting import { t, ngettext, msgid } from 'ttag' in my sites javascript makes the browser go The requested module '../../node_modules/ttag/dist/index.js' does not provide an export named 't'.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexMostcommented, Feb 19, 2019

As far as I can see it makes sense to use rollup instead of webpack for ttag distribution. It seems like it can easily distribute es6 modules format + produces smaller bundle size.

0reactions
AlexMostcommented, Feb 19, 2019

I am also for the first way.

So, to fix this issue we need to:

  1. Provide es6 imports support for our dependencies: dedent, and plural-forms. We can put dedent right inside the ttag repo. Not sure that we can do the same with plural-forms.
  2. Also we must upgrade babel-plugin-ttag to recognize ttag/es6 imports.
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to distribute an ES6 library - Medium
The bad news is that Node.js doesn't yet support ES6 modules ( import / export ). If Node.js >= 6 is your only...
Read more >
JavaScript modules - MDN Web Docs
Import maps allow modules to be imported using bare module names (as in Node.js), and can also simulate importing modules from packages, both ......
Read more >
The JavaScript Modules Handbook – Complete Guide to ES ...
Specifically, a module is simply a JavaScript file that allows you to share its code with other files within your project (or with...
Read more >
Understanding (all) JavaScript module formats and tools
When TypeScript transpiles, the ES module code can either be kept as ES6, or transpiled to other formats, including CommonJS/Node.js, ...
Read more >
16. Modules - Exploring JS
ES6 is the first time that JavaScript has built-in modules. ... The goal for ECMAScript 6 modules was to create a format that...
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