-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require is undefined importing in to a less file #8
Comments
Is the path correct (../globals/colors.js)? |
Thanks for your reply yes it is.
…On Wed, 24 Apr 2019 5:36 am Tamas G. Toth, ***@***.***> wrote:
Is the path is correct (../globals/colors.js)?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOT4CSF4VSYFIK7TCGFUTTPR5QL7ANCNFSM4HHU4JZA>
.
|
when i @import from ‘.less’ in a less file, it not work |
@WilkinWendy could you insert the error message you get? Would be nice to have more info about environment where the error occurs. |
@tompascall i mean less allows us to @import a .less file in a less file ,in webpack this is handled by less-loader,. My problem is if try to load js-variables in a less file which is imported by another less file, the error occurs. |
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.
The text was updated successfully, but these errors were encountered: