Skip to content

Commit 8b5c16d

Browse files
authored
fix: set compilerOptions.css to 'external' when emitCss was true (#211)
for version 4
1 parent 4271788 commit 8b5c16d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ module.exports = function (options = {}) {
4242
const { onwarn, emitCss = true } = rest;
4343

4444
if (emitCss) {
45+
const [majorVer] = VERSION.split('.');
46+
const cssOptionValue = majorVer > 3 ? 'external' : false;
4547
if (compilerOptions.css) {
4648
console.warn(
47-
`${PREFIX} Forcing \`"compilerOptions.css": false\` because "emitCss" was truthy.`
49+
`${PREFIX} Forcing \`"compilerOptions.css": ${typeof cssOptionValue === 'string' ? `"${cssOptionValue}"` : cssOptionValue}\` because "emitCss" was truthy.`
4850
);
4951
}
50-
compilerOptions.css = false;
52+
compilerOptions.css = cssOptionValue;
5153
}
5254

5355
return {

0 commit comments

Comments
 (0)