class Snowpacker::Configuration
- Snowpacker::Configuration
- Reference
- Object
Defined in:
ext/athena.crsnowpacker/configuration.cr
Instance Method Summary
-
#asset_regex : Regex
The regex snowpacker.cr uses to match assets.
-
#asset_regex=(asset_regex : Regex)
The regex snowpacker.cr uses to match assets.
-
#config_path : String
The path
snowpack.config.js
will be loaded from. -
#config_path=(config_path : String)
The path
snowpack.config.js
will be loaded from. -
#enabled : Bool
If the dev server & extension middleware should be enabled.
-
#enabled=(enabled : Bool)
If the dev server & extension middleware should be enabled.
-
#hmr : Bool
Enables/Disables Hot Module Reloading.
-
#hmr=(hmr : Bool)
Enables/Disables Hot Module Reloading.
-
#hmr_matching_regex : Regex
The regex used to locate where the HMR scripts should be injected.
-
#hmr_matching_regex=(hmr_matching_regex : Regex)
The regex used to locate where the HMR scripts should be injected.
-
#hostname : String
The hostname requests will be redirected too.
-
#hostname=(hostname : String)
The hostname requests will be redirected too.
-
#node_env : String
The
NODE_ENV
that will be prepended to the command starting the snowpack dev server. -
#node_env=(node_env : String)
The
NODE_ENV
that will be prepended to the command starting the snowpack dev server. -
#port : Int32
The port requests will be redirected too.
-
#port=(port : Int32)
The port requests will be redirected too.
Instance Method Detail
The regex snowpacker.cr uses to match assets. If a request matches this, the request will be redirected to snowpacks dev server. The default regex should be fine for most use cases but this configuration is exposed for advanced use cases.
The regex snowpacker.cr uses to match assets. If a request matches this, the request will be redirected to snowpacks dev server. The default regex should be fine for most use cases but this configuration is exposed for advanced use cases.
If the dev server & extension middleware should be enabled. Ensure this is true
when you
want the dev server to run. Set false
in production.
If the dev server & extension middleware should be enabled. Ensure this is true
when you
want the dev server to run. Set false
in production.
Enables/Disables Hot Module Reloading. Snowpacker will inject the neccessary HMR scripts into a HTML document.
Enables/Disables Hot Module Reloading. Snowpacker will inject the neccessary HMR scripts into a HTML document.
The regex used to locate where the HMR scripts should be injected. You shouldn't typically need to change this. Snowpacker, by default, injects the scripts at the bottom of your HTML document so they load last. Change this value to something else if you would like the scripts to injected into a different location.
The regex used to locate where the HMR scripts should be injected. You shouldn't typically need to change this. Snowpacker, by default, injects the scripts at the bottom of your HTML document so they load last. Change this value to something else if you would like the scripts to injected into a different location.
The hostname requests will be redirected too. This does NOT change the hostname snowpack actually runs on.
Make sure this matches the hostname in your snowpack.config.js
file. Snowpack defaults to localhost
.
The hostname requests will be redirected too. This does NOT change the hostname snowpack actually runs on.
Make sure this matches the hostname in your snowpack.config.js
file. Snowpack defaults to localhost
.
The NODE_ENV
that will be prepended to the command starting the snowpack dev server. This can
be overwritten via Crystal's environment variables with ENV["NODE_ENV"] = "my_env"
if you
would prefer.
Crystal nor Node can access environment variables outside of their process for safety reasons. Because of this, snowpacker.cr prepends the env to the command.
Example: `"NODE_ENV=#{Snowpacker.config.node_env} npx snowpack #{cmd}"
The NODE_ENV
that will be prepended to the command starting the snowpack dev server. This can
be overwritten via Crystal's environment variables with ENV["NODE_ENV"] = "my_env"
if you
would prefer.
Crystal nor Node can access environment variables outside of their process for safety reasons. Because of this, snowpacker.cr prepends the env to the command.
Example: `"NODE_ENV=#{Snowpacker.config.node_env} npx snowpack #{cmd}"
The port requests will be redirected too. This does NOT change the port snowpack actually runs on.
Make sure this matches the port in your snowpack.config.js
file. Snowpack defaults to 8080
.
The port requests will be redirected too. This does NOT change the port snowpack actually runs on.
Make sure this matches the port in your snowpack.config.js
file. Snowpack defaults to 8080
.