File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
121121 ensureCommandShouldRunInEnvironment ( command , env )
122122
123123 return {
124- base : userConfig . base ?? command === 'build' ? resolveBase ( pluginConfig , assetUrl ) : '' ,
124+ base : userConfig . base ?? ( command === 'build' ? resolveBase ( pluginConfig , assetUrl ) : '' ) ,
125125 publicDir : userConfig . publicDir ?? false ,
126126 build : {
127127 manifest : userConfig . build ?. manifest ?? ! ssr ,
Original file line number Diff line number Diff line change @@ -64,6 +64,18 @@ describe('laravel-vite-plugin', () => {
6464 expect ( ssrConfig . build . rollupOptions . input ) . toBe ( 'resources/js/ssr.ts' )
6565 } )
6666
67+ it ( 'respects users base config option' , ( ) => {
68+ const plugin = laravel ( {
69+ input : 'resources/js/app.ts' ,
70+ } ) [ 0 ]
71+
72+ const userConfig = { base : '/foo/' }
73+
74+ const config = plugin . config ( userConfig , { command : 'build' , mode : 'production' } )
75+
76+ expect ( config . base ) . toBe ( '/foo/' )
77+ } )
78+
6779 it ( 'accepts a partial configuration' , ( ) => {
6880 const plugin = laravel ( {
6981 input : 'resources/js/app.js' ,
You can’t perform that action at this time.
0 commit comments