From d3dd5da08b9dd371c33f94727e9ece5f40247857 Mon Sep 17 00:00:00 2001 From: Constantine Genchevsky Date: Sat, 25 Jul 2020 13:23:52 +0300 Subject: [PATCH 1/2] Use CommonJS module instead of ES Makes the package more compatible with different build infrastructures --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 48e359c..f03a263 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "dist", - "module": "es2015", + "module": "commonjs", "target": "es5", "moduleResolution": "node", "strict": true, From 3737fee4b372b674dd28b7cb5a49c4195ab1ad6c Mon Sep 17 00:00:00 2001 From: Constantine Genchevsky Date: Sat, 25 Jul 2020 13:29:28 +0300 Subject: [PATCH 2/2] Use CommonJS export --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c4053a7..bad7296 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import { Component } from 'vue'; type createContext = (defaultValue: unknown) => { Provider: Component; Consumer: Component }; -export const createContext: createContext = (defaultValue) => { +module.exports.createContext = (defaultValue) => { const _key = `_${Date.now()}${Math.random()}`; const _context = { from: _key,