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.

Rollup build instead of webpack

See original GitHub issue

Quick summary: The package deployed to unpkg.com is a webpack build. Would it be possible to add a umd module build using rollup so that the package is similar to https://unpkg.com/@angular/core@2.4.8/bundles/ https://github.com/angular/angular/tree/master/packages/core?

I’m submitting a … (check one with “x”)

[*] feature request

Current behavior Library currently built with webpack fails when included in a rollup script.

'NgxDatatableModule' is not exported by node_modules/@swimlane/ngx-datatable/release/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
build/app/app.module.js (16:9)

Expected behavior Include datatables in a rollup application

Reproduction of the problem Include ngx-datatable in a rollup build

What is the motivation / use case for changing the behavior? Webpack modules don’t work well with other applications and require large monolithic downloads which fail on slow servers.

Please tell us about your environment: Mac & Linux NPM

  • Table version: 6.3.0
  • Angular version: 2.4.9 2.4.

  • Browser: all

  • Language: TypeScript 2.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
t-bohdancommented, Nov 7, 2017

@ronnyek I resolved same issue by adding:

"externals": {
    "@swimlane/ngx-datatable": "ngxDatatable"
}

to ng-package.json based on https://github.com/dherges/ng-packagr/issues/119#issuecomment-327871092

lib.externals is key-value pair of external dependencies of an Angular library. The key should be the import path (as used in TypeScript import {} from “” statement. The value should be the module ID for the UMD bundle.

in case of ngx-datatable UMD bundle name is ngxDatatable (based on https://github.com/swimlane/ngx-datatable/issues/599#issuecomment-286899739)

0reactions
ronnyekcommented, Sep 25, 2017

Any updates on this one? I’m currently trying to wrap up something with ng-packagr and running into this same problem… No name was provided for external module ‘@swimlane/ngx-datatable/index’ in options.globals - guessing ‘index’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I use Rollup, and not Webpack | by Paul Sweeney | Medium
While Webpack is focused on using CommonJS as its primary module system and converting everything to that, Rollup decided to take the opposite ......
Read more >
Rollup vs. Parcel vs. webpack: Which Is the Best Bundler?
Rollup has node polyfills for import/export, but webpack doesn't. · Rollup has support for relative paths in config, but webpack doesn't — which...
Read more >
Rollup vs. Webpack -- A Comparison - OpenReplay Blog
A JavaScript module bundler called Rollup turns small chunks of code into something bigger and more sophisticated, like a library or application ...
Read more >
Rollup vs Webpack | Learn Top 6 Comparisons with ... - eduCBA
Rollup makes it simple for package publications and has an easier configuration. It has better tree shaking and offers only a minimum size...
Read more >
best approach to use rollup instead of webpack to output esm ...
create a new Build-task to be used in the new env instead of webpack: bit create build-task modules/rollup-task; in the new Env use...
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