diff --git a/src/core/create_compilers/RollupCompiler.ts b/src/core/create_compilers/RollupCompiler.ts index 65fa20e7b..f953760b0 100644 --- a/src/core/create_compilers/RollupCompiler.ts +++ b/src/core/create_compilers/RollupCompiler.ts @@ -39,10 +39,14 @@ export default class RollupCompiler { this.chunks.push(chunk); }, transform: (code: string, id: string) => { - if (/\.css$/.test(id)) { - this.css_files.push({ id, code }); - return ``; + if (!/\.css$/.test(id)) return; + + if (/styleInject/.test(code)) { + return code; } + + this.css_files.push({ id, code }); + return ``; } });