File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
packages/vite-plugin-tempest/src Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,19 @@ test('the configuration can be loaded', async () => {
1212 expect ( config ) . toHaveProperty ( 'manifest' )
1313 expect ( config ) . toHaveProperty ( 'entrypoints' )
1414} )
15+
16+ test ( 'the configuration can be overriden' , async ( ) => {
17+ process . env . TEMPEST_PLUGIN_CONFIGURATION_OVERRIDE = JSON . stringify ( {
18+ build_directory : 'build' ,
19+ bridge_file_name : 'vite-tempest' ,
20+ manifest : 'manifest.json' ,
21+ entrypoints : [ ] ,
22+ } )
23+
24+ const config = await loadTempestConfiguration ( )
25+
26+ expect ( config ) . toHaveProperty ( 'build_directory' )
27+ expect ( config ) . toHaveProperty ( 'bridge_file_name' )
28+ expect ( config ) . toHaveProperty ( 'manifest' )
29+ expect ( config ) . toHaveProperty ( 'entrypoints' )
30+ } )
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ const VITE_CONFIG_COMMAND = 'vite:config'
66
77export async function loadTempestConfiguration ( ) : Promise < TempestViteConfiguration > {
88 try {
9+ const override = process . env . TEMPEST_PLUGIN_CONFIGURATION_OVERRIDE
10+ if ( override ) {
11+ return JSON . parse ( override )
12+ }
13+
914 const { stdout } = await exec ( `${ php . value } ${ TEMPEST_BIN } ${ VITE_CONFIG_COMMAND } ` )
1015 const json = stdout . match ( / \{ .* \} / s)
1116
You can’t perform that action at this time.
0 commit comments