Skip to content

Commit

Permalink
fix: webpack watch
Browse files Browse the repository at this point in the history
need to include all src files for web (index.json)
  • Loading branch information
jperl committed Jul 7, 2020
1 parent 973e290 commit 252921f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "qawolf",
"version": "1.0.1",
"description": "Create browser tests 10x faster",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/src/index.js",
"types": "./build/src/index.d.ts",
"files": [
"build",
"expect-playwright.js",
Expand Down Expand Up @@ -97,6 +97,6 @@
"webpack-virtual-modules": "^0.2.2"
},
"bin": {
"qawolf": "./build/index.js"
"qawolf": "./build/src/index.js"
}
}
2 changes: 1 addition & 1 deletion src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { buildHowlCommand } from './howlCommand';
import { buildTestCommand } from './testCommand';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../../package');
const pkg = require('../../../package');
updateNotifier({ pkg }).notify();

program.usage('<command> [options]').version(pkg.version);
Expand Down
2 changes: 1 addition & 1 deletion src/web/addScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFileSync } from 'fs';
import { BrowserContext, Page } from 'playwright-core';
import { forEachPage, initEvaluateScript } from '../utils';

const scriptPath = require.resolve('../../build/qawolf.web.js');
const scriptPath = require.resolve('../../qawolf.web.js');

export const webScript = readFileSync(scriptPath, 'utf8').replace(
'var qawolf =',
Expand Down
10 changes: 7 additions & 3 deletions test/cli/create.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ describe('npx qawolf create', () => {
beforeAll(async () => {
server = await launchServer();

child = spawn('node', ['node_modules/qawolf/build/index.js', 'create'], {
env: { ...process.env, QAW_CREATE_E2E_TEST: '1' },
});
child = spawn(
'node',
['node_modules/qawolf/build/src/index.js', 'create'],
{
env: { ...process.env, QAW_CREATE_E2E_TEST: '1' },
},
);

child.stderr.setEncoding('utf8');
child.stderr.on('data', (chunk: string) => {
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"rootDir": "./src",
"rootDir": "./",
"outDir": "./build",
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": ["src/**/*.ts"],
"include": [
"node_modules/an-array-of-english-words/index.json",
"src/**/*.ts"
],
"exclude": ["node_modules"]
}

0 comments on commit 252921f

Please sign in to comment.