I want to add custom alias , how i do it ?
If I've understood the Webpack Config and Webpack Resolve documentation correctly, you'd need to add a resolve section to the config in your config-overrides.js file:
module.exports = function override(config, env) {
config.resolve = {
alias: {
Utilities: path.resolve(__dirname, 'src/utilities/'),
Templates: path.resolve(__dirname, 'src/templates/')
}
};
return config;
}
how to add modules like this:
{
test: /\.module\.less$/,
loader: ExtractTextPlugin.extract(
'css?sourceMap&modules&localIdentName=[local]___[hash:base64:5]!!' +
'postcss!' +
`less-loader?{"sourceMap":true,"modifyVars":${JSON.stringify(theme)}}`
),
}
I just want to use less.modifyVars to change my own theme color.
@Duobe have you tried using react-app-rewire-less? It does the Less setup for you.
I don't use less but I see other using modifyVars in this issue https://github.com/timarney/react-app-rewired/issues/132
@timarney Thanks ! #132 is worked.
Most helpful comment
If I've understood the Webpack Config and Webpack Resolve documentation correctly, you'd need to add a resolve section to the config in your config-overrides.js file: