Skip to content

Commit c38bed7

Browse files
committedSep 3, 2019
chore: move build scripts down to child packages
1 parent b501202 commit c38bed7

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed
 

‎lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"npmClient": "yarn",
3+
"useWorkspaces": true,
4+
"packages": ["packages/*"],
5+
"version": "0.0.0"
6+
}

‎package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"packages/*"
55
],
66
"scripts": {
7-
"clean": "rm -rf ./dist",
8-
"build": "parcel build ./packages/server/src/ui/index.html --public-url=/app",
9-
"build:watch": "parcel watch ./packages/server/src/ui/index.html --public-url=/app",
10-
"build:source-map-explorer": "npm run clean && npm run build && ./scripts/source-map-explorer.sh",
7+
"clean": "lerna exec --parallel 'rm -rf ./dist'",
8+
"build": "lerna run --scope @lhci/server build",
9+
"build:watch": "lerna run --scope @lhci/server build:watch --stream",
10+
"build:source-map-explorer": "lerna run --scope @lhci/server build:source-map-explorer",
1111
"start": "./packages/cli/src/cli.js",
1212
"start:seed-data-in-viewer": "node ./scripts/open-seed-report-in-viewer.js",
1313
"start:seed-database": "node ./scripts/seed-database.js ./packages/cli/test/fixtures/lighthouserc.json",

‎packages/server/package.json

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"main": "./src/server.js",
44
"version": "0.1.0",
55
"license": "Apache-2.0",
6+
"scripts": {
7+
"clean": "rm -rf ./dist",
8+
"build": "parcel build ./src/ui/index.html --public-url=/app",
9+
"build:watch": "parcel watch ./src/ui/index.html --public-url=/app",
10+
"build:source-map-explorer": "npm run clean && npm run build && ../../scripts/source-map-explorer.sh"
11+
},
612
"dependencies": {
713
"@lhci/utils": "0.1.0",
814
"body-parser": "^1.18.3",

‎packages/server/src/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const createProjectsRouter = require('./api/routes/projects.js');
1515
const StorageMethod = require('./api/storage/storage-method.js');
1616
const {errorMiddleware} = require('./api/express-utils.js');
1717

18-
const DIST_FOLDER = path.join(__dirname, '../../../dist');
18+
const DIST_FOLDER = path.join(__dirname, '../dist');
1919

2020
/**
2121
* @param {LHCI.ServerCommand.Options} options

0 commit comments

Comments
 (0)
Please sign in to comment.