Skip to content

Commit aa3c6ec

Browse files
committed
fix: inject PLATFORM env variables into the node build
https://leanticket.cn/tickets/23715
1 parent 3b884d6 commit aa3c6ec

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.babelrc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22
"presets": [
33
"es2015"
44
],
5-
"plugins": ["transform-runtime"],
5+
"plugins": [
6+
"transform-runtime",
7+
[
8+
"transform-inline-environment-variables",
9+
{
10+
"include": [
11+
"PLATFORM"
12+
]
13+
}
14+
]
15+
],
616
"env": {
717
"test": {
8-
"plugins": ["istanbul"]
18+
"plugins": [
19+
"istanbul"
20+
]
921
}
1022
}
1123
}

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"babel-core": "^6.26.3",
4646
"babel-loader": "^7.0.0",
4747
"babel-plugin-istanbul": "^2.0.0",
48+
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
4849
"babel-plugin-transform-runtime": "^6.23.0",
4950
"babel-preset-es2015": "^6.24.1",
5051
"cross-env": "^5.1.3",

0 commit comments

Comments
 (0)