Answer the question
In order to leave comments, you need to log in
How to configure component path in VuePress via alias?
Hello. Need help. Maybe I'm doing something wrong, but I can't figure out what. I want to implement access to components through an alias in VuePress. It seems that I am doing everything as it should, but even does not want to work
Call line in the Layout.vue file
import Header from '@/components/base/Header/Header.vue'
const path = require('path')
module.exports = {
title: 'Test',
description: "Test using VuePress",
module: {
rules: [{
test: /\.scss$/,
use: [
"style-loader",
"sass-loader",
{
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[local]_[hash:base64:8]'
}
}
]
}]
},
configureWebpack: {
resolve: {
alias: {
"@": path.resolve(__dirname, 'src/')
}
},
}
}
Error: Can't resolve '@/components/base/Header/Header.vue'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question