Skip to content

Commit 5073dbd

Browse files
author
Matt Kane
committed
Switch to per-env
1 parent 3ef0e4e commit 5073dbd

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

template/package.json

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"version": "0.0.0",
55
"license": "MIT",
66
"scripts": {
7-
"start":
8-
"if-env NODE_ENV=production && npm run -s serve || npm run -s dev",
7+
"start": "per-env",
8+
"start:production": "npm run -s serve",
9+
"start:development": "npm run -s dev",
910
"build": "preact build",
1011
"serve": "preact build && preact serve",
1112
"dev": "preact watch",
@@ -14,20 +15,28 @@
1415
"precommit": "lint-staged"
1516
},
1617
"lint-staged": {
17-
"*.{js,jsx,css,md,scss}": ["prettier --write", "git add"],
18-
"*.{ts,tsx}": ["tslint --fix", "git add"]
18+
"*.{js,jsx,css,md,scss}": [
19+
"prettier --write",
20+
"git add"
21+
],
22+
"*.{ts,tsx}": [
23+
"tslint --fix",
24+
"git add"
25+
]
1926
},
2027
"eslintConfig": {
2128
"extends": "eslint-config-aerian"
2229
},
23-
"eslintIgnore": ["build/*"],
30+
"eslintIgnore": [
31+
"build/*"
32+
],
2433
"devDependencies": {
2534
"@types/jest": "^23.3.10",
2635
"husky": "^1.2.0",
2736
"identity-obj-proxy": "^3.0.0",
28-
"if-env": "^1.0.0",
2937
"jest": "^23.6.0",
3038
"lint-staged": "^8.1.0",
39+
"per-env": "^1.0.2",
3140
"preact-cli": "^2.2.1",
3241
"preact-render-spy": "^1.3.0",
3342
"prettier": "^1.15.3",
@@ -55,17 +64,25 @@
5564
"^.+\\.tsx?$": "ts-jest"
5665
},
5766
"verbose": true,
58-
"setupFiles": ["<rootDir>/src/tests/__mocks__/browserMocks.js"],
67+
"setupFiles": [
68+
"<rootDir>/src/tests/__mocks__/browserMocks.js"
69+
],
5970
"testURL": "http://localhost:8080",
60-
"moduleFileExtensions": ["js", "jsx", "ts", "tsx"],
61-
"moduleDirectories": ["node_modules"],
71+
"moduleFileExtensions": [
72+
"js",
73+
"jsx",
74+
"ts",
75+
"tsx"
76+
],
77+
"moduleDirectories": [
78+
"node_modules"
79+
],
6280
"testMatch": [
6381
"**/__tests__/**/*.[jt]s?(x)",
6482
"**/?(*.)(spec|test).[jt]s?(x)"
6583
],
6684
"moduleNameMapper": {
67-
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
68-
"<rootDir>/src/tests/__mocks__/fileMock.js",
85+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/tests/__mocks__/fileMock.js",
6986
"\\.(css|less|scss)$": "identity-obj-proxy",
7087
"^./style$": "identity-obj-proxy",
7188
"^preact$": "<rootDir>/node_modules/preact/dist/preact.min.js",

0 commit comments

Comments
 (0)