I have a theme for plone with .less files, my configuration is this:
const makeConfig = require('sc-recipe-staticresources');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const SpritesmithPlugin = require('webpack-spritesmith');
let data = makeConfig(
// name
'sct.elmirador',
// shortName
'elmirador',
// path
//`${__dirname}/dist`,
// `${__dirname}/../src/sct/elmirador/browser/static`,
`${__dirname}/../src/sct/elmirador/theme/elmirador-theme`,
//publicPath
//'',
'++resource++sct.elmirador/',
// '++theme++sct.elmirador/',
//callback
(config, options) => {
config.entry.unshift(
`./app/elmirador.less`,
);
},
);
data.module.rules.push( {
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
],// compiles Less to CSS
},);
module.exports = data;
console.log(module.exports.module.rules);
I get this:
Version: webpack 3.12.0
Time: 968ms
Asset Size Chunks Chunk Names
elmirador-.js 907 bytes 0 [emitted] main
index.html 556 bytes [emitted]
resources.pt 114 bytes [emitted]
[0] multi ./app/elmirador.less ./app/elmirador.js 40 bytes {0} [built]
[1] ./app/elmirador.js 261 bytes {0} [built]
[2] ./app/js/filea.js 170 bytes {0} [built]
ERROR in multi ./app/elmirador.less ./app/elmirador.js
Module not found: Error: Can't resolve 'less-loader' in '/home/mubra/elmirador/elmirador/webpack'
@ multi ./app/elmirador.less ./app/elmirador.js
when I run "npm install less-loader" webpack breaks
in short, I don't know if you can configure this version of webpack to use less files instead of scss
I have a theme for plone with .less files, my configuration is this:
I get this:
Version: webpack 3.12.0 Time: 968ms Asset Size Chunks Chunk Names elmirador-.js 907 bytes 0 [emitted] main index.html 556 bytes [emitted] resources.pt 114 bytes [emitted] [0] multi ./app/elmirador.less ./app/elmirador.js 40 bytes {0} [built] [1] ./app/elmirador.js 261 bytes {0} [built] [2] ./app/js/filea.js 170 bytes {0} [built] ERROR in multi ./app/elmirador.less ./app/elmirador.js Module not found: Error: Can't resolve 'less-loader' in '/home/mubra/elmirador/elmirador/webpack' @ multi ./app/elmirador.less ./app/elmirador.jswhen I run "npm install less-loader" webpack breaks
in short, I don't know if you can configure this version of webpack to use less files instead of scss