package/rules/less.js in shakapacker-7.3.0.beta.1 vs package/rules/less.js in shakapacker-8.0.1
- old
+ new
@@ -1,19 +1,20 @@
-const path = require('path')
-const { canProcess } = require('../utils/helpers')
-const getStyleRule = require('../utils/get_style_rule')
-const { includePaths } = require('../config')
+const path = require("path")
+const { canProcess } = require("../utils/helpers")
+const getStyleRule = require("../utils/getStyleRule")
-module.exports = canProcess('less-loader', (resolvedPath) =>
+const {
+ additional_paths: paths,
+ source_path: sourcePath
+} = require("../config")
+
+module.exports = canProcess("less-loader", (resolvedPath) =>
getStyleRule(/\.(less)(\.erb)?$/i, [
{
loader: resolvedPath,
options: {
lessOptions: {
- paths: [
- path.resolve(__dirname, 'node_modules'),
- ...includePaths
- ]
+ paths: [path.resolve(__dirname, "node_modules"), sourcePath, ...paths]
},
sourceMap: true
}
}
])