From bd68b1824e3c4c15a66ae95e6b433661ebadd620 Mon Sep 17 00:00:00 2001 From: Even Stensberg Date: Wed, 14 Mar 2018 01:39:21 +0100 Subject: [PATCH] cli(init): fix init regexp (#344) * cli(init): fix init regexp * cli(init): add literal quotes to module --- lib/generators/init-generator.js | 8 ++++---- lib/generators/utils/module.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/generators/init-generator.js b/lib/generators/init-generator.js index 590b8a6982a..9bc7b62df79 100644 --- a/lib/generators/init-generator.js +++ b/lib/generators/init-generator.js @@ -156,7 +156,7 @@ module.exports = class InitGenerator extends Generator { "style-loader", "css-loader" ); - regExpForStyles = new RegExp(/\.(scss|css)$/); + regExpForStyles = `${new RegExp(/\.(scss|css)$/)}`; if (this.isProd) { ExtractUseProps = ` use: [{ @@ -187,7 +187,7 @@ module.exports = class InitGenerator extends Generator { } break; case "LESS": - regExpForStyles = new RegExp(/\.(less|css)$/); + regExpForStyles = `${new RegExp(/\.(less|css)$/)}`; this.dependencies.push( "less-loader", "less", @@ -240,7 +240,7 @@ module.exports = class InitGenerator extends Generator { "precss", "autoprefixer" ); - regExpForStyles = new RegExp(/\.css$/); + regExpForStyles = `${new RegExp(/\.css$/)}`; if (this.isProd) { ExtractUseProps = ` use: [{ @@ -292,7 +292,7 @@ module.exports = class InitGenerator extends Generator { break; case "CSS": this.dependencies.push("style-loader", "css-loader"); - regExpForStyles = new RegExp(/\.css$/); + regExpForStyles = `${new RegExp(/\.css$/)}`; if (this.isProd) { ExtractUseProps = ` use: [{ diff --git a/lib/generators/utils/module.js b/lib/generators/utils/module.js index 8c98246d42b..2b46c03881c 100644 --- a/lib/generators/utils/module.js +++ b/lib/generators/utils/module.js @@ -9,7 +9,7 @@ */ module.exports = _ => { return { - test: new RegExp(/\.js$/), + test: `${new RegExp(/\.js$/)}`, exclude: "/node_modules/", loader: "'babel-loader'", options: {