rollup-plugin-typescript2: No compiler errors compared to tsc

Hi,

I’m trying to use the plugin, however I’m getting no compiler errors at all when building with rollup, compared to running tsc.

Here’s the output from tsc:

src/main/ts/core/api/track-event.ts(83,17): error TS2345: Argument of type 'string' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/helpers/renderer-helpers.ts(71,12): error TS2345: Argument of type '"load"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/helpers/renderer-helpers.ts(77,12): error TS2345: Argument of type '"error"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/set-attribute.ts(26,12): error TS2345: Argument of type '"load"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/set-attribute.ts(31,12): error TS2345: Argument of type '"error"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/foundation/zepto.ts(1621,14): error TS2322: Type '(selector: any, context: any) => any' is not assignable to type 'ZeptoStatic'.
  Property 'camelCase' is missing in type '(selector: any, context: any) => any'.

Here’s my rollup config:

import typescript from 'rollup-plugin-typescript2';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import path from 'path';
import license from 'rollup-plugin-license';
import cleanup from 'rollup-plugin-cleanup';

export default {
  entry: './src/main/ts/bootstrap.ts',

  format: 'iife',

  moduleName: 'testmodule',

  dest: './dist/out.js',

  sourceMap: false,

  plugins: [
    typescript({
      check: true,
      include: [ "*.ts+(|x)", "**/*.ts+(|x)" ]
	}),
    resolve({
      jsnext: true,
      main: true,
      browser: true
	}),
    commonjs({
      include: 'node_modules/**',
      exclude: [ 'node_modules/@types/**' ],
      extensions: [ '.js' ],
      ignoreGlobal: false,
      sourceMap: false,
      namedExports: {
        'node_modules/js-cookie/src/js.cookie.js': [ 'get', 'set', 'remove']
      }
    }),
    license({
      sourceMap: true,
      banner: {
        file: path.join(__dirname, 'tools/decorations/license.txt')
      }
    }),
    cleanup({
      comments: 'some'
    })
  ]
}

And tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es5",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "removeComments": false,
    "noEmitHelpers": true,
    "sourceMap": false,
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "maxNodeModuleJsDepth": 1,
    "types" : [
      "es6-shim",
      "js-cookie",
      "query-string"
    ]
  },
  "include": [
    "**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "buildOnSave": false
}

I’m using TypeScript v2.2.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

re: Cannot write file because it would overwrite input file, there is report on typescript about similar issues. So likely not related to this plugin: https://github.com/Microsoft/TypeScript/issues/14538

@jdalrymple this is expected – the plugin sets moduleResolution: node regardless of what is in tsconfig (see readme for this and other enforced options).