Skip to content

Commit

Permalink
Merge pull request Urigo#1433 from Kamshak/master
Browse files Browse the repository at this point in the history
fix(css-compiler): escape css output
  • Loading branch information
Urigo authored Sep 24, 2016
2 parents 6cc8822 + 691690e commit 349414b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const jsStringEscape = Npm.require('js-string-escape');

/**
* Contains addCompileResult that decides
Expand Down Expand Up @@ -52,10 +53,7 @@ BasicCompiler = class BasicCompiler {
// JS-module is being added as 'lazy', i.e.
// it'll appear on the client only if it's
// explicitly imported somewhere in the code base.
let css = Babel.compile(`
const css = \`${resultCss}\`;
module.exports.default = css;`
);
let css = Babel.compile('const css = "' + jsStringEscape(resultCss) + '"; module.exports.default = css;');
inputFile.addJavaScript({
data: css.code,
path: sourcePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Package.describe({
});

Npm.depends({
'less': 'https://github.com/meteor/less.js/tarball/8130849eb3d7f0ecf0ca8d0af7c4207b0442e3f6'
'less': 'https://github.com/meteor/less.js/tarball/8130849eb3d7f0ecf0ca8d0af7c4207b0442e3f6',
'js-string-escape': '1.0.1'
});

Package.onUse(function(api) {
Expand Down

0 comments on commit 349414b

Please sign in to comment.