Just wanted to drop this here:
I have a project that uses rollup-plugin-postcss with postcss-less and when I tried to add less-plugin-lists it broke the build:
[!] (plugin commonjs--resolver) Error: Error evaluating function `each`: Cannot read properties of undefined (reading 'slice')
The error was thrown when the parser hit an each() in a .less file.
I've poked a bit at the problem and it looks like something in for.js breaks Less' own each(). As soon as I remove the line
require("./for")(less, manager);
from main.js, everything works fine.
Relevant rollup config:
import postcss from 'rollup-plugin-postcss';
import autoprefixer from 'autoprefixer';
import postcssImport from 'postcss-import';
{
minimize: true,
plugins: [
autoprefixer,
postcssImport,
],
use: [
['less', {plugins: [new LessPluginLists()],}],
]
},
Just wanted to drop this here:
I have a project that uses
rollup-plugin-postcsswithpostcss-lessand when I tried to addless-plugin-listsit broke the build:The error was thrown when the parser hit an
each()in a.lessfile.I've poked a bit at the problem and it looks like something in
for.jsbreaks Less' owneach(). As soon as I remove the linefrom
main.js, everything works fine.Relevant rollup config: