Skip to content

Commit e416b89

Browse files
committed
feat: Move the settings to module settings
This allows for easier upgrades to Vite in the future. BREAKING CHANGE: The default `manifestFileName` for latest version of Vite is now `.vite/manifest.json`.
1 parent 29801ef commit e416b89

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

ModuleConfig.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ component {
77
this.applicationHelper = [ "includes/helpers.cfm" ];
88

99
function configure() {
10+
settings = {
11+
"hotFilePath" : "/includes/hot",
12+
"buildDirectory" : "/includes/build",
13+
"manifestFileName" : ".vite/manifest.json"
14+
}
1015
}
1116

1217
}

models/Vite.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
component singleton accessors="true" {
22

3-
property name="hotFilePath" default="/includes/hot";
4-
property name="buildDirectory" default="/includes/build";
5-
property name="manifestFileName" default="manifest.json";
3+
property name="hotFilePath" inject="box:setting:hotFilePath@vite-helpers";
4+
property name="buildDirectory" inject="box:setting:buildDirectory@vite-helpers";
5+
property name="manifestFileName" inject="box:setting:manifestFileName@vite-helpers";
66

77
/**
88
* Gets the assets path based on the entrypoints passed

tests/resources/app/includes/build/.vite/.gitkeep

Whitespace-only changes.

tests/specs/unit/ViteHelperSpec.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
44

55
variables.hotServerUrl = "http://127.0.0.1:5173";
66
variables.hotFilePath = expandPath( "/app/includes/hot" );
7-
variables.manifestFilePath = expandPath( "/app/includes/build/manifest.json" );
7+
variables.manifestFilePath = expandPath( "/app/includes/build/.vite/manifest.json" );
88
variables.manifestFileContents = {
99
"resources/assets/css/app.css" : {
1010
"file" : "assets/app-00d284d6.css",

0 commit comments

Comments
 (0)