Browse Source

use __dirname for path resolution to ensure gloabl install works correctly

pull/171/head
butlerx 6 years ago
parent
commit
6eca32e873
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 2
      package.json
  2. 2
      src/server/server.ts
  3. 23
      tsconfig.json
  4. 4
      webpack.config.babel.js

2
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": {

2
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(/\/*$/, '');

23
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"]
}

4
webpack.config.babel.js

@ -35,6 +35,10 @@ export default [
libraryTarget: 'commonjs2',
filename: '[name].js',
},
node: {
__filename: false,
__dirname: false,
},
externals: [nodeExternals()],
module: {
rules: [

Loading…
Cancel
Save