diff --git a/package.json b/package.json index e934d934..9eeb0b0b 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,15 @@ }, "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "engines": { "node": ">= 6.10.0" }, "scripts": { - "ava": "tsc -d && nyc ava", - "build": "npm run clean && tsc -d", + "ava": "tsc -d && cp package.json ./dist/package.json && nyc ava", + "build": "npm run clean && tsc -d && cp package.json ./dist/package.json", "clean": "rimraf dist", "coverage": "npm run ava", "precommit": "lint-staged", diff --git a/src/util.ts b/src/util.ts index 898f80dc..3da33337 100644 --- a/src/util.ts +++ b/src/util.ts @@ -7,13 +7,7 @@ import * as CDP from 'chrome-remote-interface' import * as AWS from 'aws-sdk' export const version: string = ((): string => { - if (fs.existsSync(path.join(__dirname, '../package.json'))) { - // development (look in /src) return require('../package.json').version - } else { - // production (look in /dist/src) - return require('../../package.json').version - } })() export async function setViewport(