You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Usage.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,3 +153,19 @@ It also supports variants to handle plural rules. The special variable `%count%`
153
153
154
154
Finally if there is a `keyname` in the translation path, an extra function is created accepting a keyname variable to choose the translation. This is for convenience and should be used with care, if the keyname does not match any translation the function returns an empty string.
155
155
156
+
## Replace variable during compile time
157
+
158
+
Variables can be resolved at compile time using the `envVariables` option :
159
+
160
+
```
161
+
envVariables: {
162
+
'{site_name}': 'SITE_NAME', // example of variable in routing
163
+
'%site_name%': 'SITE_NAME', // example of variable in translation
Copy file name to clipboardExpand all lines: parcel/README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,13 +70,14 @@ This plugin follows parcel's zero-config philosophy and will automatically confi
70
70
*`watchExtensions`: Which file extensions to watch (defaults to `php`, `yaml`, `yml`, `xml`)
71
71
*`watchConfig`: Which files to watch for configuration changes (defaults to `elm.json`, `elm-package.json`, `package.json`, `composer.json`)
72
72
*`dev`: Use symfony's env=dev or env=prod (defaults to parcel's own dev value)
73
-
*`generatedCodeFolder`: Where to put generated code. Automatically added to your elm's `source-directories` config (defaults to `elm-stuff/generated-code/elm-symfony-bridge`)
74
-
*`tmpFolder`: Where to put temporary (defaults to `elm-stuff/generated-code/elm-symfony-bridge`)
73
+
*`elmRoot`: Where to put generated code. Automatically added to your elm's `source-directories` config (defaults to `elm-stuff/generated-code/elm-symfony-bridge`)
74
+
*`outputFolder`: Where to put temporary (defaults to `elm-stuff/generated-code/elm-symfony-bridge`)
75
75
*`elmVersion`: Elm version the generated code should be compatible with (defaults to 0.19 if a `elm.json` file is present, 0.18 if a `elm-package.json` file is present)
76
76
*`enableRouting`: Enable generating routes (defaults to true)
77
77
*`urlPrefix`: When dev is true, which prefix to use when generating urls (defaults to `/index.php` or `/app_dev.php` depending on which is found)
78
78
*`enableTranslations`: Enable generating translations (defaults to true if the willdurand/js-translation-bundle package is installed)
79
79
*`lang`: Lang to use when exporting translations (defaults to the default lang configured in symfony)
80
+
*`envVariables`: Variables to replace during compile time
80
81
81
82
If these rules don't work for you, you can override any of these parameters in your `package.json` under the `elm-symfony-bridge` key like so:
0 commit comments