Skip to content

Commit

Permalink
fix: set compilerOptions.css to 'external' when emitCss was true (#211)
Browse files Browse the repository at this point in the history
for version 4
  • Loading branch information
gucheen committed Jun 26, 2023
1 parent 4271788 commit 8b5c16d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Expand Up @@ -42,12 +42,14 @@ module.exports = function (options = {}) {
const { onwarn, emitCss = true } = rest;

if (emitCss) {
const [majorVer] = VERSION.split('.');
const cssOptionValue = majorVer > 3 ? 'external' : false;
if (compilerOptions.css) {
console.warn(
`${PREFIX} Forcing \`"compilerOptions.css": false\` because "emitCss" was truthy.`
`${PREFIX} Forcing \`"compilerOptions.css": ${typeof cssOptionValue === 'string' ? `"${cssOptionValue}"` : cssOptionValue}\` because "emitCss" was truthy.`
);
}
compilerOptions.css = false;
compilerOptions.css = cssOptionValue;
}

return {
Expand Down

0 comments on commit 8b5c16d

Please sign in to comment.