From e5c602b64317e79709d1ac88b28c36d8c3e77f22 Mon Sep 17 00:00:00 2001 From: Ranieri Benvenuto Date: Sat, 6 Feb 2021 22:16:13 -0300 Subject: [PATCH] fix(webpack): change webpack loader output to fix babel warnings (#697) Co-authored-by: Ranieri Benvenuto --- src/webpack.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/webpack.js b/src/webpack.js index 06f9f4ec..3e3fa8d9 100644 --- a/src/webpack.js +++ b/src/webpack.js @@ -33,7 +33,7 @@ module.exports = function(content) { options.type = commentType[1] } - let output = `import css from 'styled-jsx/css';\n\nexport default css` + let output = `import css from 'styled-jsx/css';\n\nconst styles = css` if (options.type === 'global') { // css.global`` @@ -46,7 +46,10 @@ module.exports = function(content) { // Escape backticks and backslashes: “`” ⇒ “\`”, “\” ⇒ “\\” // (c) https://git.io/fNZzr - output += `\`${content.replace(/[`\\]/g, match => '\\' + match)}\`` + output += `\`${content.replace( + /[`\\]/g, + match => '\\' + match + )}\`;\n\nexport default styles;` this.callback(null, output) }