Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

typescript example is no longer valid #365

Open
Hulkmaster opened this issue Jun 29, 2020 · 2 comments
Open

typescript example is no longer valid #365

Hulkmaster opened this issue Jun 29, 2020 · 2 comments
Milestone

Comments

@Hulkmaster
Copy link

Version

5.0.0

Reproduction link

https://github.com/vuejs/rollup-plugin-vue/tree/master/cookbook/typescript-simple

Steps to reproduce

try to upgrade
fail
profit

What is expected?

up to date versions

What is actually happening?

fail


current TS example implementation uses outdated rollup version and deprecated TS plugin (also doesn't work with vue-plugin ^6 version, because requires additional libs)

just by upgrading versions it doesn't work

would be nice to have up-to-date working TS example

@DrMabuse23
Copy link

@elasim
Copy link

elasim commented Jul 31, 2020

this may helps. (still u need define shims for *.vue, of course)

import pluginTypescript from '@rollup/plugin-typescript';
import vue from 'rollup-plugin-vue';

export default {
	input: 'src/index.ts',
	output: {
		format: 'esm',
		name: 'lib/index.js',
		dir: 'lib',
		sourcemap: true,
	},
	external: [
		'vue',
		'vue-class-component',
		'vue-property-decorator',
		'tslib',
		'vue-runtime-helpers/dist/normalize-component.mjs',
	],
	plugins: [
		pluginTypescript(),
		vue({
			normalizer: '~vue-runtime-helpers/dist/normalize-component.mjs',
		}),
	],
};
{
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./lib",
    "target": "es5",
    "module": "commonjs",
    "sourceMap": true,
    "declaration": true,
    "importHelpers": true,
    "strict": true
  }
}

@znck znck added this to the Zero Issues milestone Oct 22, 2020
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

4 participants