From 0679cccb6dac483e7318aa14bffeb29a49f32bcf Mon Sep 17 00:00:00 2001 From: Richardo2016 Date: Wed, 28 Nov 2018 22:14:23 +0800 Subject: [PATCH] make fib-app ts-debugable --- .npmignore | 2 ++ lib.ts | 7 +++++++ package.json | 2 +- src/index.ts | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lib.ts create mode 100644 src/index.ts diff --git a/.npmignore b/.npmignore index 8aeaa2d..dc4c326 100644 --- a/.npmignore +++ b/.npmignore @@ -4,3 +4,5 @@ docs test.db* src + +/lib.ts \ No newline at end of file diff --git a/lib.ts b/lib.ts new file mode 100644 index 0000000..eb439a0 --- /dev/null +++ b/lib.ts @@ -0,0 +1,7 @@ +import util = require('util') + +if (util.buildInfo().fibjs !== '0.25.0') { + module.exports = require('./src') +} else { + module.exports = require('./lib/index.js') +} \ No newline at end of file diff --git a/package.json b/package.json index 9a915a5..5ac5a4d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "fib-app", "version": "1.13.0", "description": "", - "main": "lib/app", + "main": "./lib", "types": "@types/index.d.ts", "scripts": { "build": "fib-typify src -o lib -c .typifyrc.json", diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..8feb023 --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export = require('./app') \ No newline at end of file