panManfredini / lit-element-effector

Mixin to add an Effector Store to lit-element
MIT License
7 stars 0 forks source link

Doesn't compile with ts-loader #2

Open panManfredini opened 4 years ago

panManfredini commented 4 years ago

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);
panManfredini commented 4 years ago

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'
    }
}