From 6eca32e8734094a1978ad7953f96783e11f8b8e1 Mon Sep 17 00:00:00 2001 From: butlerx Date: Sun, 13 Jan 2019 13:11:07 +0000 Subject: [PATCH] use __dirname for path resolution to ensure gloabl install works correctly --- package.json | 2 +- src/server/server.ts | 2 +- tsconfig.json | 23 +++++++---------------- webpack.config.babel.js | 4 ++++ 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index d6528c0..4e53d13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wetty.js", - "version": "1.1.1", + "version": "1.1.2", "description": "WeTTY = Web + TTY. Terminal access in browser over http/https", "homepage": "https://github.com/krishnasrinivas/wetty", "repository": { diff --git a/src/server/server.ts b/src/server/server.ts index 775db10..4b789da 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -12,7 +12,7 @@ import logger from './logger'; import events from './emitter'; import { SSLBuffer, Server } from './interfaces'; -const distDir = path.join('./', 'dist', 'client'); +const distDir = path.join(__dirname, 'client'); const trim = (str: string): string => str.replace(/\/*$/, ''); diff --git a/tsconfig.json b/tsconfig.json index 78cac36..b459415 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,22 +1,13 @@ { "compilerOptions": { - "module": "commonjs", - "outDir": "./dist", - "allowJs": true, - "esModuleInterop": false, "target": "es6", - "noImplicitAny": true, - "moduleResolution": "node", + "module": "commonjs", + "lib": ["es2015"], "sourceMap": true, - "baseUrl": ".", - "paths": { - "*": [ - "node_modules/", - "src/types/*" - ] - } + "strict": true, + "moduleResolution": "node", + "typeRoots": ["node_module/@types"], + "outDir": "./dist" }, - "include": [ - "./src/**/*.ts" - ] + "include": ["./src/**/*.ts"] } diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 98bbc0e..ee1a8f7 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -35,6 +35,10 @@ export default [ libraryTarget: 'commonjs2', filename: '[name].js', }, + node: { + __filename: false, + __dirname: false, + }, externals: [nodeExternals()], module: { rules: [