publish es6 modules to npm
See original GitHub issueI was looking to use pdf.js today via something like import {pdfjs} from pdfjs-dist/pdf.js
and learned that all that is available is a require module.
Would it be possible to add es6 modules somewhere on npm?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:63
- Comments:12
Top Results From Across the Web
How To Publish An ES6 Module To NPM - Medium
So you want to publish your own NPM module, and you want to write that code in ES6 syntax? Here are the challenges...
Read more >How to publish a module written in ES6 to NPM?
The pattern I have seen so far is to keep the es6 files in a src directory and build your stuff in npm's...
Read more >articles/how-to-build-and-publish-es6-npm-modules-today ...
The fundamental idea behind publishing transpiled ES6 modules is that, you create two folders: a source folder, and a distribution folder: The source...
Read more >es6-modules - npm search
My template for node modules with lint, tests, code coverage, type checking, CI, semantic release and interoperability between ES6 modules and CommonJs.
Read more >How to build, test and publish an npm package in ES6 [Twitch ...
I this video I show you how to create, build, test and release a node module package that's hosted on npm.The most important...
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 FreeTop 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
Top GitHub Comments
Please keep in mind that the primary focus of development for this library is the Firefox PDF Viewer.
For the general PDF.js library, we’ve been doing various work (over the years) to clean-up and simplify things in order to reduce the number of builds that we have to maintain/support. Hence why we provide both browser and Node.js support in the same builds in e.g.
pdfjs-dist
, and thus it’s not currently planned to add any “new” builds.And neither should it be, since the only thing that we officially support is the functionality accessed via https://github.com/mozilla/pdf.js/blob/master/src/pdf.js respectively https://github.com/mozilla/pdf.js/blob/master/web/pdf_viewer.component.js (once those files are built and and published in
pdfjs-dist
).Please keep in mind that using the “raw”
src/
-files directly has never be officially recommended nor supported. (Hence the only thing that may, some day in the future, become supported are ESM-versions of the files in e.g. the https://github.com/mozilla/pdfjs-dist/tree/master/build and https://github.com/mozilla/pdfjs-dist/tree/master/web folders.)Not really, since as mentioned above we don’t want to add even more builds and we also want to support both browsers and Node.js environments with the same builds.
As an interim workaround, we’ve published this:
https://github.com/bundled-es-modules/pdfjs-dist https://www.npmjs.com/package/@bundled-es-modules/pdfjs-dist