ngx-contextmenu icon indicating copy to clipboard operation
ngx-contextmenu copied to clipboard

SystemJS build with rollup

Open isaacplmann opened this issue 8 years ago • 3 comments
trafficstars

From @AnthonyBr on February 15, 2017 17:44

Hello,

When I generate my angular2 project: node_modules\.bin\rollup -c rollup-config.js

I have the error in the title:

?   'ContextMenuComponent' is not exported by node_modules\angular2-contextmenu\
angular2-contextmenu.js

To bundle my project, I use rollup, as described here: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

As said in the documentation: Rollup can only Tree Shake ES2015 modules which have import and export statements.

And ContextMenuComponent has no export statement.

The project works well when I start the project with systemjs.

Thank you for help, A. Breneliere

Copied from original issue: isaacplmann/angular2-contextmenu#48

isaacplmann avatar Apr 03 '17 13:04 isaacplmann

You're right. I'm not really sure the best way to export both commonjs (for webpack et al.) and es2015 (for rollup). If you could point me towards another library that does this well or a how-to article, that will help me resolve this.

isaacplmann avatar Apr 03 '17 13:04 isaacplmann

On the subject, is there no longer a commonjs export for this module? I'm getting an unexpected token export error now that I'm trying to upgrade from angular2-contextmenu because ngx-contextmenu seems to point to an es6 module by default.

symbyte avatar Apr 10 '17 14:04 symbyte

Yes, I think that broke in the migration. I need to figure out how to fix that.

isaacplmann avatar Apr 11 '17 14:04 isaacplmann