Skip to content

Instantly share code, notes, and snippets.

@jcao02
jcao02 / event-bus-consumer.ts
Last active September 26, 2023 13:25
Enum module augmentation
import { Event, Payload, bus } from './event-bus'
// Module augmentation here
declare module './event-bus' {
interface Event {
SIGN_IN: 'SIGN_IN'
SIGN_OUT: 'SIGN_OUT'
}
interface Payload {
@jcao02
jcao02 / package.json
Last active September 13, 2020 15:07
Rollup configuration for VueJS SFC + TypeScript tree-shakable library
{
"name": "your-library-name",
"version": "0.1.0",
"module": "dist/index.js",
"sideEffects": false,
"scripts": {
"build": "rollup --config ./config/rollup.config.js",
"serve": "rollup --config ./config/rollup.config.js --watch",
"test": "jest --config ./config/jest.config.js --rootDir ."
},