Giter Site home page Giter Site logo

Module build coming out CJS. about skatejs HOT 3 OPEN

Westbrook avatar Westbrook commented on May 26, 2024
Module build coming out CJS.

from skatejs.

Comments (3)

Westbrook avatar Westbrook commented on May 26, 2024

I just tested tsc(path.dirname(w.config.module), w.dir, 'es2015', 'es2015') and it seems to work. The output is now:

import Element from '@skatejs/element';
import { render } from 'lit-html';
export default class extends Element {
    renderer() {
        return render(this.render(), this.renderRoot);
    }
}
export { html as h } from 'lit-html';

More like I'd expect. It is the same output as the ESNext build, which might mean there are other settings to include, but if this is looking closer to what you'd expect to, I'm happy to supply a PR.

from skatejs.

Westbrook avatar Westbrook commented on May 26, 2024

There may be a secondary issue or getting TS to point to the file listed in the module property of package.json, but pointing it manually gets this working.

from skatejs.

Westbrook avatar Westbrook commented on May 26, 2024

There is one issue, it seems the settings as they are now do output a reference to global.Promise when processing @skatejs/element, which bombs in the browser:

function delay(fn) {
    if (typeof global.Promise === 'function') {
        // @ts-ignore - Promise.resove() indeed does exist.
        global.Promise.resolve().then(fn);
    }
    else {
        setTimeout(fn);
    }
}

This TS things is...

from skatejs.

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.