@@ -265,45 +265,6 @@ if (import.meta.hot) {
265265 path . resolve ( resolvedViteConfig . root , clientOutputDirectory )
266266 ) ,
267267 } ;
268-
269- if ( workerConfig . containers ?. length ) {
270- workerConfig . containers = workerConfig . containers . map (
271- ( container ) => {
272- const baseDir = workerConfig . configPath
273- ? path . dirname ( workerConfig . configPath )
274- : resolvedViteConfig . root ;
275- // Wrangler's config validation resolves to container.configuration.image, even though it is deprecated
276- const image =
277- container . configuration ?. image ?? container . image ;
278- if ( isDockerfile ( image , workerConfig . configPath ) ) {
279- const output = {
280- ...container ,
281- image : path . resolve ( baseDir , image ) ,
282- ...( container . image_build_context
283- ? {
284- image_build_context : path . resolve (
285- baseDir ,
286- container . image_build_context
287- ) ,
288- }
289- : { } ) ,
290- } ;
291- // however, wrangler deploy will re-resolve the config, so we should
292- // deduplicate the container.configuration.image field in favour of
293- // the non-deprecated one when we write out the deploy config
294- delete output . configuration ?. image ;
295- // if we don't do this, we get a warning that container.configuration is deprecated
296- if (
297- output . configuration &&
298- Object . keys ( output . configuration ) . length === 0
299- ) {
300- delete output . configuration ;
301- }
302- return output ;
303- } else return container ;
304- }
305- ) ;
306- }
307268 } else {
308269 workerConfig . assets = undefined ;
309270 }
@@ -1089,17 +1050,12 @@ if (import.meta.hot) {
10891050 if ( ! config . containers ?. length || config . dev . enable_containers === false ) {
10901051 return undefined ;
10911052 }
1092- const baseDir = config . configPath
1093- ? path . dirname ( config . configPath )
1094- : resolvedViteConfig . root ;
10951053 return config . containers . map ( ( container ) => {
10961054 if ( isDockerfile ( container . image , config . configPath ) ) {
1097- const absoluteDockerfilePath = path . resolve ( baseDir , container . image ) ;
10981055 return {
1099- dockerfile : absoluteDockerfilePath ,
1100- image_build_context : container . image_build_context
1101- ? path . resolve ( baseDir , container . image_build_context )
1102- : path . dirname ( absoluteDockerfilePath ) ,
1056+ dockerfile : container . image ,
1057+ image_build_context :
1058+ container . image_build_context ?? path . dirname ( container . image ) ,
11031059 image_vars : container . image_vars ,
11041060 class_name : container . class_name ,
11051061 image_tag : getDevContainerImageName (
0 commit comments