0π
It is your webpack configuration that is responsible for mapping the @
symbol to your components directory.
If you are using Laravel Mix, you can add something like this to your webpack.mix.js
file:
mix.webpackConfig({
resolve: {
alias: {
"@": path.resolve(
__dirname,
"resources/assets/js/components"
)
}
}
});
So your file should look like the following:
const path = require('path')
const mix = require('laravel-mix')
mix.webpackConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "resources/js/coreui/")
}
}
});
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
π€George Hanson
0π
in your package.json add:
"jest": {
"moduleNameMapper": {
"@/(.*)$": "<rootDir>/src/$1"
},
}
at the bottom of the json
π€silva96
Source:stackexchange.com