I using react, I want to use absolute path when import component.
so I customized webpack.mix.js like below code.
That's worked well in browser.
But VScode show error.
Could not find a declaration file for module
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix
.ts('resources/js/app.tsx', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
mix
.webpackConfig({
resolve: {
extensions: [".js", ".jsx", ".tsx"],
alias: {
'@parts': path.resolve(__dirname, 'resources/js/components/parts'),
'@pages': path.resolve(__dirname, 'resources/js/components/pages')
}
}
});
if (mix.inProduction()) {
mix.version()
}
