File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ export interface PkgConfigOptions {
127
127
treeshake ?: TreeshakingOptions
128
128
/** @alpha */
129
129
experimentalLogSideEffects ?: boolean
130
+ /**
131
+ * Adds [hash] to chunk filenames, generally only useful if `@sanity/pkg-utils` is used to deploy a package directly to a CDN.
132
+ * It's not needed when publishing to npm for consumption by other libraries, bundlers and frameworks.
133
+ * @defaultValue false
134
+ */
135
+ hashChunkFileNames ?: boolean
130
136
}
131
137
/**
132
138
* Default runtime of package exports
Original file line number Diff line number Diff line change @@ -194,12 +194,13 @@ export function resolveRollupConfig(
194
194
outputOptions : {
195
195
chunkFileNames : ( ) => {
196
196
const parts = outputExt . split ( '.' )
197
+ const prefix = config ?. rollup ?. hashChunkFileNames ? '[name]-[hash]' : '[name]'
197
198
198
199
if ( parts . length === 3 ) {
199
- return `_chunks/[name]-[hash] .${ parts [ 2 ] } `
200
+ return `_chunks/${ prefix } .${ parts [ 2 ] } `
200
201
}
201
202
202
- return `_chunks/[name]-[hash] ${ outputExt } `
203
+ return `_chunks/${ prefix } ${ outputExt } `
203
204
} ,
204
205
compact : minify ,
205
206
dir : outDir ,
You can’t perform that action at this time.
0 commit comments