Skip to content

Commit 8fe9b97

Browse files
committed
fix(package): use cross-env to make environment variables work properly for all platforms
1 parent a3d3ba4 commit 8fe9b97

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

examples/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
"formatter": "prettier --check .",
99
"test": "npm run linter && npm run typecheck && npm run formatter",
1010
"clean-examples": "rm -rf ./public ../.parcel-cache",
11-
"start:example": "npm run clean-examples && cross-env $(cat .env) PARCEL_AUTOINSTALL=false parcel serve $EXAMPLE_ENTRY --dist-dir public --port 1234 --no-cache",
12-
"start:map": "EXAMPLE_ENTRY=./basic-google-map/index.html npm run start:example",
13-
"start:map-with-markers": "EXAMPLE_ENTRY=./google-map-with-markers/index.html npm run start:example",
14-
"start:multiple-maps": "EXAMPLE_ENTRY=./multiple-google-maps/index.html npm run start:example",
15-
"start:geocoding-service": "EXAMPLE_ENTRY=./geocoding-service/index.html npm run start:example",
16-
"start:places-service": "EXAMPLE_ENTRY=./places-service/index.html npm run start:example",
17-
"start:places-service-with-element": "EXAMPLE_ENTRY=./places-service-with-element/index.html npm run start:example",
18-
"start:places-autocomplete-widget": "EXAMPLE_ENTRY=./places-autocomplete-widget/index.html npm run start:example",
19-
"start:directions-service": "EXAMPLE_ENTRY=./directions-service/index.html npm run start:example",
20-
"start:distance-matrix-service": "EXAMPLE_ENTRY=./distance-matrix-service/index.html npm run start:example",
21-
"start:elevation-service": "EXAMPLE_ENTRY=./elevation-service/index.html npm run start:example",
22-
"start:max-zoom-service": "EXAMPLE_ENTRY=./max-zoom-service/index.html npm run start:example",
23-
"start:places-autocomplete-service": "EXAMPLE_ENTRY=./places-autocomplete-service/index.html npm run start:example",
24-
"start:street-view-panorama-map": "EXAMPLE_ENTRY=./street-view-panorama-map/index.html npm run start:example",
25-
"start:street-view-panorama-element": "EXAMPLE_ENTRY=./street-view-panorama-with-element/index.html npm run start:example",
11+
"start:example": "npm run clean-examples && cross-env $(cat .env) cross-env PARCEL_AUTOINSTALL=false parcel serve $EXAMPLE_ENTRY --dist-dir public --port 1234 --no-cache",
12+
"start:map": "cross-env EXAMPLE_ENTRY=./basic-google-map/index.html npm run start:example",
13+
"start:map-with-markers": "cross-env EXAMPLE_ENTRY=./google-map-with-markers/index.html npm run start:example",
14+
"start:multiple-maps": "cross-env EXAMPLE_ENTRY=./multiple-google-maps/index.html npm run start:example",
15+
"start:geocoding-service": "cross-env EXAMPLE_ENTRY=./geocoding-service/index.html npm run start:example",
16+
"start:places-service": "cross-env EXAMPLE_ENTRY=./places-service/index.html npm run start:example",
17+
"start:places-service-with-element": "cross-env EXAMPLE_ENTRY=./places-service-with-element/index.html npm run start:example",
18+
"start:places-autocomplete-widget": "cross-env EXAMPLE_ENTRY=./places-autocomplete-widget/index.html npm run start:example",
19+
"start:directions-service": "cross-env EXAMPLE_ENTRY=./directions-service/index.html npm run start:example",
20+
"start:distance-matrix-service": "cross-env EXAMPLE_ENTRY=./distance-matrix-service/index.html npm run start:example",
21+
"start:elevation-service": "cross-env EXAMPLE_ENTRY=./elevation-service/index.html npm run start:example",
22+
"start:max-zoom-service": "cross-env EXAMPLE_ENTRY=./max-zoom-service/index.html npm run start:example",
23+
"start:places-autocomplete-service": "cross-env EXAMPLE_ENTRY=./places-autocomplete-service/index.html npm run start:example",
24+
"start:street-view-panorama-map": "cross-env EXAMPLE_ENTRY=./street-view-panorama-map/index.html npm run start:example",
25+
"start:street-view-panorama-element": "cross-env EXAMPLE_ENTRY=./street-view-panorama-with-element/index.html npm run start:example",
2626
"preversion": "echo \"To create a new library version run 'npm version -w library' in the repository root.\""
2727
},
2828
"license": "MIT",

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
"test": "npm run test -ws --if-present",
1111
"start:library": "npm start -w library",
1212
"start:example": "./start-example.sh",
13-
"start:map-example": "EXAMPLE=map run-p start:library start:example",
14-
"start:map-with-markers-example": "EXAMPLE=map-with-markers run-p start:library start:example",
15-
"start:multiple-maps-example": "EXAMPLE=multiple-maps run-p start:library start:example",
16-
"start:geocoding-service-example": "EXAMPLE=geocoding-service run-p start:library start:example",
17-
"start:places-service-example": "EXAMPLE=places-service run-p start:library start:example",
18-
"start:places-service-with-element-example": "EXAMPLE=places-service-with-element run-p start:library start:example",
19-
"start:places-autocomplete-widget-example": "EXAMPLE=places-autocomplete-widget run-p start:library start:example",
20-
"start:directions-service-example": "EXAMPLE=directions-service run-p start:library start:example",
21-
"start:distance-matrix-service-example": "EXAMPLE=distance-matrix-service run-p start:library start:example",
22-
"start:elevation-service-example": "EXAMPLE=elevation-service run-p start:library start:example",
23-
"start:max-zoom-service-example": "EXAMPLE=max-zoom-service run-p start:library start:example",
24-
"start:places-autocomplete-service-example": "EXAMPLE=places-autocomplete-service run-p start:library start:example",
25-
"start:street-view-panorama-map-example": "EXAMPLE=street-view-panorama-map run-p start:library start:example",
26-
"start:street-view-panorama-element-example": "EXAMPLE=street-view-panorama-element run-p start:library start:example",
13+
"start:map-example": "cross-env EXAMPLE=map run-p start:library start:example",
14+
"start:map-with-markers-example": "cross-env EXAMPLE=map-with-markers run-p start:library start:example",
15+
"start:multiple-maps-example": "cross-env EXAMPLE=multiple-maps run-p start:library start:example",
16+
"start:geocoding-service-example": "cross-env EXAMPLE=geocoding-service run-p start:library start:example",
17+
"start:places-service-example": "cross-env EXAMPLE=places-service run-p start:library start:example",
18+
"start:places-service-with-element-example": "cross-env EXAMPLE=places-service-with-element run-p start:library start:example",
19+
"start:places-autocomplete-widget-example": "cross-env EXAMPLE=places-autocomplete-widget run-p start:library start:example",
20+
"start:directions-service-example": "cross-env EXAMPLE=directions-service run-p start:library start:example",
21+
"start:distance-matrix-service-example": "cross-env EXAMPLE=distance-matrix-service run-p start:library start:example",
22+
"start:elevation-service-example": "cross-env EXAMPLE=elevation-service run-p start:library start:example",
23+
"start:max-zoom-service-example": "cross-env EXAMPLE=max-zoom-service run-p start:library start:example",
24+
"start:places-autocomplete-service-example": "cross-env EXAMPLE=places-autocomplete-service run-p start:library start:example",
25+
"start:street-view-panorama-map-example": "cross-env EXAMPLE=street-view-panorama-map run-p start:library start:example",
26+
"start:street-view-panorama-element-example": "cross-env EXAMPLE=street-view-panorama-element run-p start:library start:example",
2727
"preversion": "echo \"To create a new library version run 'npm version -w library' in the repository root.\""
2828
},
2929
"keywords": [

0 commit comments

Comments
 (0)