Spaces:
Runtime error
Runtime error
fix(write-version): use a node script to write the version
Browse files- package.json +1 -1
- scripts/write-version.js +6 -0
package.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
"dev": "next dev",
|
30 |
"postinstall": "npm run write-version",
|
31 |
"prepare": "husky install",
|
32 |
-
"write-version": "
|
33 |
},
|
34 |
"lint-staged": {
|
35 |
"*.{ts,tsx,jsx}": [
|
|
|
29 |
"dev": "next dev",
|
30 |
"postinstall": "npm run write-version",
|
31 |
"prepare": "husky install",
|
32 |
+
"write-version": "node scripts/write-version.js"
|
33 |
},
|
34 |
"lint-staged": {
|
35 |
"*.{ts,tsx,jsx}": [
|
scripts/write-version.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const fs = require('fs');
|
2 |
+
const packageJson = require('../package.json');
|
3 |
+
|
4 |
+
const envVars = `NEXT_PUBLIC_VERSION=${packageJson.version}\n`;
|
5 |
+
|
6 |
+
fs.appendFileSync('.env', envVars);
|