panManfredini / lit-element-effector

Mixin to add an Effector Store to lit-element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't compile with ts-loader

panManfredini opened this issue · comments

basically same issue as #1.

I realize that webpack + tsloader does not compile at all. The customelements.define function fails.

Webpack standalone works (so compiling first with tsc).
Rollup+rollup-plugin-typescript2 works.

Quick solution

customElements.define("my-element",<any>myElement);

Rollup config that works for me:

// rollup.config.js
import typescript from 'rollup-plugin-typescript2';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
export default {
    input: [
	"./main.ts"
    ],
 
    plugins: [
      nodeResolve( {browser:true}),
      typescript(
          {
            allowjs: true,
            "allowSyntheticDefaultImports" : true,
            "experimentalDecorators": true,
            "module": "es6",
            "moduleResolution":"Node",
            "target": "es2018",
            "noImplicitAny": true,  
          }
        ),
        commonjs(),
        json(),
    ],
    output:{
      dir : 'dist/js/',
      format : 'es'
    }
}