Nuxt.js bebel warn "loose" 설정

Tuhyon😀·2021년 5월 4일
1

Nuxt

목록 보기
1/1

무수히 많은 경고가 나왔다.

웃긴 건 같은 소스임에도 회사에서는 안뜨고 괜찮은데, 집에서만 Warn 이 뜬다. VSCode에서의 setting.json 설정도 동일함에도 뜬다. 즉, 이유는 난 모르겠다 ㅎ.ㅎ) 나중에 알게 되거든 수정해야지!

Warn

 WARN  Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
        ["@babel/plugin-proposal-private-methods", { "loose": true }]
to the "plugins" section of your Babel config. (repeated 5 times)

해결 방법

  • nuxt.config.js 파일에 다음과 같이 작성한다.
build: {
	babel: {
		plugins: [['@babel/plugin-proposal-private-methods', { loose: true }]],
	},
},

참고

profile
메모를 하기 위한 공간입니다.

0개의 댓글