8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to auto import less variables in all files, but fails. Here are my settings:
less
// craco.config.js module.export = { plugins: [ { plugin: styleResourcesLoader, options: { patterns: path.resolve(__dirname, './src/styles/variables.less') } } ] }
It doesn't work! How can I fix it? Thanks!!!!
The text was updated successfully, but these errors were encountered:
same question!!!help!!! @CoderAWei I do like this: configure: webpackConfig => { const loaders = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf)).oneOf; loaders.push({ test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader', { loader: 'style-resources-loader', options: { patterns: [ path.resolve(__dirname, 'src/styles/_variable.less'), ], injector: 'append' } }] }) return webpackConfig } It doesn't work too!
configure: webpackConfig => { const loaders = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf)).oneOf; loaders.push({ test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader', { loader: 'style-resources-loader', options: { patterns: [ path.resolve(__dirname, 'src/styles/_variable.less'), ], injector: 'append' } }] }) return webpackConfig }
Sorry, something went wrong.
I want to auto import less variables in all files, but fails. Here are my settings: // craco.config.js module.export = { plugins: [ { plugin: styleResourcesLoader, options: { patterns: path.resolve(__dirname, './src/styles/variables.less') } } ] } It doesn't work! How can I fix it? Thanks!!!! module.exports = { plugins: [ { plugin: CracoLessPlugin, options: { modifyLessRule: (lessRule) => { console.log(JSON.stringify(lessRule)) lessRule.use.push({ loader: 'style-resources-loader', options: { patterns: path.resolve(__dirname, 'src/styles/_variable.less'), injector: 'append' } }) return lessRule }, lessLoaderOptions: { lessOptions: { javascriptEnabled: true, }, }, }, }, ] }
module.exports = { plugins: [ { plugin: CracoLessPlugin, options: { modifyLessRule: (lessRule) => { console.log(JSON.stringify(lessRule)) lessRule.use.push({ loader: 'style-resources-loader', options: { patterns: path.resolve(__dirname, 'src/styles/_variable.less'), injector: 'append' } }) return lessRule }, lessLoaderOptions: { lessOptions: { javascriptEnabled: true, }, }, }, }, ] }
No branches or pull requests
I want to auto import
less
variables in all files, but fails. Here are my settings:It doesn't work! How can I fix it? Thanks!!!!
The text was updated successfully, but these errors were encountered: