Skip to content

Commit

Permalink
blank out bundle.css (or equivalent) in hot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rixo committed Apr 23, 2020
1 parent da878d3 commit f2ee7e4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ module.exports = function svelte(options = {}) {
);
fixed_options.css = true;
}

if (typeof options.css === 'function') {
// blank out existing bundle.css
options.css({
write: dest => {
hotPluginOptions.stripCss = dest;
fs.writeFileSync(dest, '', 'utf8');
}
});
css = null;
}
}

const plugin = {
Expand Down

0 comments on commit f2ee7e4

Please sign in to comment.