@@ -230,7 +230,14 @@ export function normalizeRollupOutputOptionsObject(
230
230
return 'build/qwik-city.js' ;
231
231
}
232
232
233
- const sanitizedPath = sanitizePath ( optimizer , chunkInfo . name ) ;
233
+ // Sanitize The path to use dashes instead of slashes, to keep the same folder strucutre as without debug:true.
234
+ // Besides, Rollup doesn't accept absolute or relative paths as inputs for the [name] placeholder for the same reason.
235
+ const path = optimizer . sys . path ;
236
+ const relativePath = path . relative ( optimizer . sys . cwd ( ) , chunkInfo . name ) ;
237
+ const sanitizedPath = relativePath
238
+ . replace ( / ^ ( \. \. \/ ) + / , '' )
239
+ . replace ( / ^ \/ + / , '' )
240
+ . replace ( / \/ / g, '-' ) ;
234
241
chunkInfo . name = sanitizedPath ;
235
242
return `build/[name].js` ;
236
243
} ;
@@ -277,20 +284,6 @@ export function normalizeRollupOutputOptionsObject(
277
284
return outputOpts ;
278
285
}
279
286
280
- /**
281
- * @private Sanitize The path to use dashes instead of slashes, to keep the same folder strucutre as
282
- * without debug:true. Besides, Rollup doesn't accept absolute or relative paths as inputs for the
283
- * [name] placeholder for the same reason.
284
- */
285
- export function sanitizePath ( optimizer : Optimizer , pathToSanitize : string ) {
286
- const path = optimizer . sys . path ;
287
- const relativePath = path . relative ( optimizer . sys . cwd ( ) , pathToSanitize ) ;
288
- return relativePath
289
- . replace ( / ^ ( \. \. \/ ) + / , '' )
290
- . replace ( / ^ \/ + / , '' )
291
- . replace ( / \/ / g, '-' ) ;
292
- }
293
-
294
287
export function createRollupError ( id : string , diagnostic : Diagnostic ) {
295
288
const loc = diagnostic . highlights [ 0 ] ?? { } ;
296
289
const err : Rollup . RollupError = Object . assign ( new Error ( diagnostic . message ) , {
0 commit comments