Published target compatibility with webpack/rollup
See original GitHub issueThe current publishing flow uses a tsconfig.json file (the one in src) and transpiles the module imports/exports to UMD.
When trying to bundle the vscode-css-languageservice
npm package alongside monaco-editor-core
, webpack errors about require
being used in a way that cannot be staticly parsed.
Would you consider publishing to es2015 modules as well, and linking to that entry-point from the package.json’s “module” field?
To match with other solutions online, dist
folder could be something in the form:
dist/umd/...
dist/esm/...
etc.
The “module” field is being automatically picked by webpack, rollup, and other bundlers, and does not collide with the “main” field. It is only used during bundling.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to Bundle JavaScript With Rollup — Step-by- ...
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >rollup.js
Compatibility. Importing CommonJS. Rollup can import existing CommonJS modules through a plugin. Publishing ES Modules. To make sure your ES modules ...
Read more >You may not need a bundler for your NPM library
We can use a single command, yarn publish to publish to npm ... Uses "target": "es2018" - This is does a small amount...
Read more >Publish, ship, and install modern JavaScript for faster ...
This guide demonstrates how to publish modern packages to npm, and how to install and optimally bundle modern JavaScript packages.
Read more >Code-splitting for libraries—bundling for npm with Rollup 1.0
Publishing monolithic bundles ... };. This instructs Rollup to start with src/main.js and bundle it together with all its dependencies into a UMD ......
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
possible workaround: matt-gadd/umd-compat-loader reverts the umd wrapping.
I’ve installed
umd-compat-loader
using npm and added the following to my webpack configuration (inmodule>rules
):and it seems to be working
Repositories which also cannot be consumed with webpack: