diff --git a/package.json b/package.json index db25a88d9..6195a7729 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "clone": "^2.1.1", "codeclimate-test-reporter": "^0.5.0", "css-loader": "^0.28.7", + "css-to-string-loader": "^0.1.3", "extract-text-webpack-plugin": "^3.0.0", "gulp": "^3.9.1", "gulp-filelog": "^0.4.1", diff --git a/webpack.config.base.js b/webpack.config.base.js index 1d757859f..aa67b981c 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -26,17 +26,22 @@ const jsRule = { } } +const styleRule = { // load less to string + test: /\.less$/, + use: [ + { loader: 'css-to-string-loader' }, + { loader: 'css-loader' }, + { loader: 'less-loader' } + ] +} + const lessRule = { test: /\.less$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: [ - { - loader: 'css-loader' - }, - { - loader: 'less-loader' - } + { loader: 'css-loader' }, + { loader: 'less-loader' } ] }) } @@ -58,7 +63,7 @@ export const jsConfig = () => { libraryExport: 'default' }, module: { - rules: [lodashRule, jsRule] + rules: [lodashRule, jsRule, styleRule] } } } diff --git a/yarn.lock b/yarn.lock index be9a3064b..a05eabee9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1583,6 +1583,12 @@ css-selector-tokenizer@^0.7.0: fastparse "^1.1.1" regexpu-core "^1.0.0" +css-to-string-loader@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/css-to-string-loader/-/css-to-string-loader-0.1.3.tgz#c937175f2ec783969aefe14a4fba055f7b4f9562" + dependencies: + loader-utils "^0.2.15" + cssesc@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" @@ -3986,7 +3992,7 @@ loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" -loader-utils@^0.2.5: +loader-utils@^0.2.15, loader-utils@^0.2.5: version "0.2.17" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" dependencies: