Skip to content
This repository has been archived by the owner on Aug 24, 2018. It is now read-only.

Can I use web-components-loader together with typescript? #11

Open
adrian-moisa opened this issue Sep 28, 2017 · 0 comments
Open

Can I use web-components-loader together with typescript? #11

adrian-moisa opened this issue Sep 28, 2017 · 0 comments

Comments

@adrian-moisa
Copy link

adrian-moisa commented Sep 28, 2017

I would like to load web components that use typescript. Can I use web-components-loader loader in this scenario?
Currently I have the following setup:

webpack

module: {

    loaders: [{
            test: /\.ts?$/,
            loader: "awesome-typescript-loader",
            include: PUBLIC_DIR,
            exclude: /node_modules/
        },
        {
            test: /\.css$/,
            exclude: /node_modules/,
            loader: "style-loader!css-loader!autoprefixer-loader"
        },
        {
            test: /\.scss$/,
            loader: 'style-loader!css-loader!sass-loader'
        },
    ]

},

app.ts

/**
 * App
 */
export class App extends HTMLElement {

    constructor() {
        super();
    }

    connectedCallback() {
        this.innerHTML = this.template;
    }

    get template() {
        return `
        <div>This is a div</div>
        `;
    }
}
window.customElements.define('vs-app', App);
@adrian-moisa adrian-moisa changed the title Can it work together with typescript? Can I use web-components-loader together with typescript? Sep 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant