Alias for path is not working in React

jsconfig.json
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
webkpack.config.js
module.exports = {
//...
resolve: {
extensions: ['ts', 'tsx', 'js', 'jsx'],
alias: {
'@': path.resolve(__dirname, 'src/features'),
},
},
plugins: [
// ...
new webpack.DefinePlugin({
...dotenv.parsed,
'process.env': JSON.stringify(process.env),
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new Dotenv(),
// ...
],

//...
}
module.exports = {
//...
resolve: {
extensions: ['ts', 'tsx', 'js', 'jsx'],
alias: {
'@': path.resolve(__dirname, 'src/features'),
},
},
plugins: [
// ...
new webpack.DefinePlugin({
...dotenv.parsed,
'process.env': JSON.stringify(process.env),
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new Dotenv(),
// ...
],

//...
}
my alias for @ src/features is not working...pretty frustrated. any ideas?
2 Replies
Daryl
Daryl•3y ago
Stack Overflow
What is jsconfig.json?
If I search the same question on the Internet, then I’ll get only links to Visual Studio Code website and some blogs which implements it. I want to know that is jsconfig.json is specific to Visual ...
Daryl
Daryl•3y ago
You are missing paths in your jsconfig.json
Want results from more Discord servers?
Add your server