Skip to content

Commit

Permalink
fix: added fix for scss compilation issue
Browse files Browse the repository at this point in the history
When multiple css/scss files have to be rendered and assembled,
we have to create separate instances of `StencilStyles` since
each `StencilStyles` needs its own file cache for import statements
to work properly.
  • Loading branch information
2ps committed Feb 4, 2019
1 parent 9e6e225 commit e6a20a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/plugins/theme-assets/theme-assets.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const internals = {
module.exports.register = function (server, options, next) {
internals.options = Hoek.applyToDefaults(internals.options, options);

internals.stencilStyles = new StencilStyles();

server.expose('cssHandler', internals.cssHandler);
server.expose('assetHandler', internals.assetHandler);

Expand Down Expand Up @@ -83,7 +81,8 @@ internals.cssHandler = function (request, reply) {
},
};

internals.stencilStyles.compileCss('scss', params, (err, css) => {
let stencilStyles = new StencilStyles();
stencilStyles.compileCss('scss', params, (err, css) => {
if (err) {
console.error(err);
return reply(Boom.badData(err));
Expand Down

0 comments on commit e6a20a2

Please sign in to comment.