Skip to content

Commit 2f02dfe

Browse files
authored
Merge pull request #91 from developit/add-prod-test
add production test
2 parents 2688667 + a40be3d commit 2f02dfe

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: 12
14+
- name: npm install, build, and test
15+
run: |
16+
npm install
17+
npm run prepare --if-present
18+
npm test
19+
env:
20+
CI: true

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "microbundle --target node --format cjs --no-compress src/*.js",
99
"prepublishOnly": "npm run build",
1010
"dev": "karmatic watch --no-headless",
11-
"test": "npm run build && karmatic",
11+
"test": "npm run build && karmatic && NODE_ENV=production karmatic -p",
1212
"release": "npm t && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
1313
},
1414
"eslintConfig": {
@@ -45,4 +45,4 @@
4545
"peerDependencies": {
4646
"webpack": "*"
4747
}
48-
}
48+
}

webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function () {
2+
return {
3+
mode: process.env.NODE_ENV || 'development'
4+
};
5+
}

0 commit comments

Comments
 (0)