Distribution in ES6 modules format
See original GitHub issueThe 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:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
I am also for the first way.
So, to fix this issue we need to:
dedent
, andplural-forms
. We can putdedent
right inside the ttag repo. Not sure that we can do the same withplural-forms
.babel-plugin-ttag
to recognizettag/es6
imports.