IT이야기

모듈 구문 분석 실패:예기치 않은 문자 '@'(1:0) vuejs, vuetify 및 vuex

cyworld 2022. 4. 29. 23:10
반응형

모듈 구문 분석 실패:예기치 않은 문자 '@'(1:0) vuejs, vuetify 및 vuex

다음과 같이 Vuetify를 추가/통합하는 동안 오류가 발생함..main.js의 'vuetify/lib' Vue.use(Vuetify)에서 Vuetify 가져오기

오류:

ERROR in ./node_modules/vuetify/src/stylus/components/_grid.styl
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| .    @import '../bootstrap'

main.js.

import Vuetify from 'vuetify/lib'
Vue.use(Vuetify)

webpack(webpack.config.js 또는 webpack.js 또는 webpack.base.js)에서 loader를 다음과 같이 구성해야 한다.

웹팩.베이스.js

 .......other config

 module: {
   rules: [
       {
         test: /\.styl$/,
        loader: ['css-loader', 'stylus-loader']
      },

    .....other loaders
   ]
 }

 ....other config

로더를 설치하다

 npm i stylus-loader  css-loader --save-dev

이건 내 편이야.역할에 추가할 수 있다.

{
        test: /\.styl$/,
        loader: ['style-loader', 'css-loader', 'stylus-loader']
},

참조URL: https://stackoverflow.com/questions/56579527/module-parse-failed-unexpected-character-10-vuejs-vuetify-and-vuex

반응형