js-to-styles-var-loader
js-to-styles-var-loader copied to clipboard
Require is undefined importing in to a less file
const getThemeConfig = (extractLess, themeNameToPassInToLess) => { return { test: /\.(css|less)$/, use: extractLess.extract({ use: [ { loader: "css-loader", options: { importLoaders: 1 } }, 'postcss-loader', { loader: "less-loader", options: { plugins: [ lessPlugins ], globalVars: { themeName: themeNameToPassInToLess, customThemeColor: '#0000ff' } } }, { loader: "js-to-styles-var-loader" } ], fallback: "style-loader" }) }; };
I have this as my less config but then at the top of a random less file I've included: require('../globals/colors.js');
Unfortunately I'm getting required is undefined.