[ci] yarn format

This commit is contained in:
matthewp 2021-11-17 20:59:04 +00:00 committed by GitHub Actions
parent 0ce86dfdf3
commit 6abea78ecd
2 changed files with 6 additions and 13 deletions

View file

@ -73,7 +73,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
delete viteCSSPost.generateBundle; delete viteCSSPost.generateBundle;
// Move our plugin to be right before this one. // Move our plugin to be right before this one.
const ourIndex = plugins.findIndex(p => p.name === PLUGIN_NAME); const ourIndex = plugins.findIndex((p) => p.name === PLUGIN_NAME);
const ourPlugin = plugins[ourIndex]; const ourPlugin = plugins[ourIndex];
// Remove us from where we are now and place us right before the viteCSSPost plugin // Remove us from where we are now and place us right before the viteCSSPost plugin
@ -152,13 +152,8 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
const emptyChunkFiles = [...pureChunkFilenames] const emptyChunkFiles = [...pureChunkFilenames]
.map((file) => path.basename(file)) .map((file) => path.basename(file))
.join('|') .join('|')
.replace(/\./g, '\\.') .replace(/\./g, '\\.');
const emptyChunkRE = new RegExp( const emptyChunkRE = new RegExp(opts.format === 'es' ? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?` : `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`, 'g');
opts.format === 'es'
? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?`
: `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`,
'g'
)
for (const [chunkId, chunk] of Object.entries(bundle)) { for (const [chunkId, chunk] of Object.entries(bundle)) {
if (chunk.type === 'chunk') { if (chunk.type === 'chunk') {
@ -178,8 +173,6 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
} }
} }
} }
}, },
}; };
} }