GithubHelp home page GithubHelp logo

Comments (8)

sunshineo avatar sunshineo commented on August 17, 2024

Actually, I might have made a mistake when build into ES2015 module.
I've confirmed that the changes I made at https://github.com/sunshineo/angular2-infinite-scroll/commits/es2015 works for rollup. I don't need rollup-plugin-commonjs anymore.

However, now I cannot properly load it in my local dev env when using systemjs. Because the angular2-infinite-scroll.js fails to load. It looks very different now because it is es2015. Rollup is happen with it but systemjs is now not.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 17, 2024

sound like it has something to do with rollup. not sure.

from ngx-infinite-scroll.

sunshineo avatar sunshineo commented on August 17, 2024

@orizens , the current project cannot be rolled up by their rollup-plugin-commonjs is probably their issue, I've filed issue with them at rollup/rollup-plugin-commonjs#87 . However how can we package this into a es2015 (es6) model? In that case, it will be rolled up directly by the rollup main project, and many other benefits I'm sure.

I tried to do this myself, but ended up with something unusable. https://github.com/sunshineo/angular2-infinite-scroll/commits/es2015 . I cannot install it when have

"angular2-infinite-scroll:"git+https://github.com/sunshineo/angular2-infinite-scroll#es2015"

in my package.json . I can't even import it correctly in my code.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 17, 2024

this needs further investigation - what do you mean by package it to es6 model? is there other similar ng2 package that you're able to work with?

from ngx-infinite-scroll.

sunshineo avatar sunshineo commented on August 17, 2024

@orizens I'm no expert on JS standards. When I build my project to es2015 using typscript tsc, it can rollup (together with the angular2 core stuff) without the need of rollup-plugin-commonjs. Once I add some dependencies that are commonjs, for example I added angular2 material and this, I need to use the rollup-plugin-commonjs to rollup. And it worked with angular2 material but not this one.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 17, 2024

this plugin isn't based on rollup and should work with tsc.

from ngx-infinite-scroll.

sunshineo avatar sunshineo commented on August 17, 2024

Hi @orizens . Rollup is not something you base on. https://github.com/rollup/rollup http://rollupjs.org/

Rollup is a next-generation JavaScript module bundler. Author your app or library using ES2015 modules, then efficiently bundle them up into a single file for use in browsers and Node.js – even if you use advanced features like bindings and cycles.

From what I can tell, this project is written in typescript and compiled into ES5 commonjs module according to configurations here https://github.com/orizens/angular2-infinite-scroll/blob/master/tsconfig.json
I wonder if it is possible to compile it into ES2015 module that meet ES2015 standard. So that rollup can bundler it.

I tried, but I did not figure it out.

from ngx-infinite-scroll.

sunshineo avatar sunshineo commented on August 17, 2024

Hello, everyone. For this particular problem, I solved it using a feature called "namedExport" feature of the rollup common js plugin
rollup/rollup-plugin-commonjs#87

from ngx-infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.