mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
perf(nuxt): reduce multiple calls to dirname (#22800)
This commit is contained in:
parent
f06ee59d4a
commit
a70904fd8b
@ -75,11 +75,13 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
|
||||
source: ''
|
||||
})
|
||||
|
||||
const baseDir = dirname(base)
|
||||
|
||||
emitted[file] = this.emitFile({
|
||||
type: 'asset',
|
||||
name: `${filename(file)}-styles.mjs`,
|
||||
source: [
|
||||
...files.map((css, i) => `import style_${i} from './${relative(dirname(base), this.getFileName(css))}';`),
|
||||
...files.map((css, i) => `import style_${i} from './${relative(baseDir, this.getFileName(css))}';`),
|
||||
`export default [${files.map((_, i) => `style_${i}`).join(', ')}]`
|
||||
].join('\n')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user