Giter Club home page Giter Club logo

lit-element-build-rollup's Introduction

lit-element-build-rollup

A basic build config for lit-element. Uses Babel to transpile class properties and decorators, and Rollup to resolve npm-style imports.

git clone https://github.com/PolymerLabs/lit-element-build-rollup.git
cd lit-element-build-rollup
npm install
npm run build
npm run start

lit-element-build-rollup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lit-element-build-rollup's Issues

lit-element as an external?

bundling lit-element with a component adds about 100KB (unminified) code to the output.

I'd love to see a way to make lit-element an external, since we're planning on a bunch of npm packages with different components in it.

Not cross platform + Fails on copying wc node_modules

Since this is the example that is linked to by the Lit-Element website, I went ahead and tried to get it working with a very minimal component and refactored it to work on Windows to no avail.

I cloned this repo just to see if it would work and it runs into the same error I got on my project.

The system cannot find the file specified.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] copywc: `copy -r node_modules\@webcomponents\webcomponentsjs\bundles build && copy node_modules\@webcomponents\webcomponentsjs\webcomponents-loader.js build`

So I am not exactly sure how to resolve this, but the lack of documentation is frustrating to say the least. Much appreciated for putting this together.

A cross platform version that actually works would be ideal though.

Build script doesn't work with the @material/mwc-elements

Reproduce:

  • Clone repo
  • Update lit-element to latest (2.1.0)
  • Build and verify that build works (it does ;))
  • Add a component e.g. npm install @material/mwc-button & import/add in my-element
    (The element version is 0.5.0)
  • Clean and build

Two things happen:

  1. the build throws an error:
src/index.js โ†’ build/index.js...
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en#error-this-is-undefined
node_modules/@material/mwc-button/mwc-button.js
1: var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
                    ^
2:   var c = arguments.length,
3:       r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
...and 1 other occurrence

and 2. the app never renders - but throws an error in the console:

util.js:43 Uncaught TypeError: Cannot read property 'appendChild' of null
    at detectEdgePseudoVarBug (util.js:43)
    at supportsCssVariables (util.js:76)
    at ripple-directive.js:26

Using the rollup script from https://open-wc.org/building/building-rollup.html works with the mwc-elements.

Also, other elements done with lit-element work (with this script).

It is not working in IE 11

I even include custom-elements-es5-adapter.js file to index.html, still it is not working in IE11. It looks like we need to configure something in rollup.config.js with babel.

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.