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.

@nrwl/web:rollup creates a CJS file when choosing UMD as format

See original GitHub issue

Current Behavior

@nrwl/web:rollup creates a .cjs file when choosing umd as build format

See screenshot: Screenshot 2022-06-17 at 20 09 28

The content of the .cjs file looks like umd format: image

So it seems to be just the wrong file extension.

I saw the issue the first time in NX 14. NX 13.x was still OK.

Expected Behavior

@nrwl/web:rollup should create a .umd file if umd was chosen in the build format.

Steps to Reproduce

You can try it in my project (mini-rx-store) on the nx14 branch: https://github.com/spierala/mini-rx-store/tree/nx14

Environment

Node : 16.15.1 OS : darwin x64 npm : 8.11.0

nx : 14.2.4 @nrwl/angular : 14.2.4 @nrwl/cypress : 14.2.4 @nrwl/detox : Not Found @nrwl/devkit : 14.3.6 @nrwl/eslint-plugin-nx : 14.2.4 @nrwl/express : Not Found @nrwl/jest : 14.2.4 @nrwl/js : 14.2.4 @nrwl/linter : 14.2.4 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : 14.0.8 @nrwl/nx-plugin : Not Found @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.2.4 @nrwl/web : 14.2.4 @nrwl/workspace : 14.2.4 typescript : 4.7.3

Community plugins: @jscutlery/semver: 2.25.2

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alinaMihaicommented, Jul 29, 2022

it also mentions that UMD format is deprecated and will be removed in Nx 15, and I am a bit concerned as well because I am using the umd version of a package for running in a node environment.

0reactions
herrKleincommented, Dec 2, 2022

I really don’t know why UMD support has been ditched, its still in the web:rollup. And I need it to compile our webcomponent library for use with simple CDN import.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What the heck are CJS, AMD, UMD, and ESM in Javascript?
CJS imports module synchronously. You can import from a library node_modules or local dir. Either by const myLocalModule = require('./some/local ...
Read more >
What Are CJS, AMD, UMD, ESM, System, and IIFE?
A bundle can be arranged in different formats. In this article, we are going to present real examples of the CJS, AMD, UMD,...
Read more >
Bundling with Rollup: Build CommonJS to UMD
How to build a Rollup bundle to UMD, CJS, and IIFE formats for CommonJS modules. ... Create the entry file index.js : ......
Read more >
rollup.js
UMD format requires a bundle name rollup main.js --file bundle.js ... You can provide an optional Rollup configuration file to simplify command line...
Read more >
Authoring a JavaScript library that works everywhere using ...
file : `dist/${pkg.name}.min.js`, format: "umd", name: "myLibrary", esModule: false, exports: "named" ...
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