반응형
롤업 Vue2 - 빌드 실패
롤업 + vue 2 설정에 문제가 발생하여 온라인에서 모순되는 정보를 얻을 수 있습니다.롤업 구성:
import vue from 'rollup-plugin-vue';
import postcss from 'rollup-plugin-postcss';
import sass from 'rollup-plugin-sass';
import image from '@rollup/plugin-image';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
const plugins = [
vue({
preprocessStyles: true,
css: true,
compileTemplate: true
}),
commonjs({ extensions: ['.js'] }),
postcss(),
sass(),
image(),
resolve({
jsnext: true,
main: true,
browser: true
}),
babel({ exclude: 'node_modules/**', include: '**/*.js' })
];
export default {
input: 'src/main.js',
output: {
dir: 'diss',
format: 'iife',
sourcemap: false
},
plugins
};
이 설정에서는, 다음의 에러가 표시됩니다.
[!] Error: 'resolveComponent' is not exported by node_modules\vue\dist\vue.runtime.esm.js, imported by src\App.vue?vue&type=template&id=7ba5bd90&lang.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src\App.vue?vue&type=template&id=7ba5bd90&lang.js (1:9)
1: import { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue";
^
2: var _hoisted_1 = {
3: id: "app"
Error: 'resolveComponent' is not exported by node_modules\vue\dist\vue.runtime.esm.js, imported by src\App.vue?vue&type=template&id=7ba5bd90&lang.js
플러그인 목록의 vue와 commonjs를 전환하면 플러그인 순서가 중요하므로 다음 오류가 표시됩니다.
[!] (plugin commonjs) SyntaxError: Unexpected token (2:1) in D:\current_projects\uploadportal\client\src\App.vue?vue&type=template&id=7ba5bd90&lang.js
src\App.vue?vue&type=template&id=7ba5bd90&lang.js (2:1)
1:
2: <div id="app">
^
3: <router-view />
4: </div>
SyntaxError: Unexpected token (2:1) in D:\current_projects\uploadportal\client\src\App.vue?vue&type=template&id=7ba5bd90&lang.js
그 과정에서 뭔가 놓친 것 같지만, 내 연구는 아무런 해결책도 없이 토끼 굴 속으로 들어갔다.누가 제 실수를 볼 수 있나요?감사해요!
언급URL : https://stackoverflow.com/questions/67000525/rollup-vue2-build-fails
반응형
'source' 카테고리의 다른 글
| VueJ 컴포넌트 간에 공통 CSS 공유 (0) | 2022.08.08 |
|---|---|
| 구성 요소에서 이벤트를 수신하는 vuej (0) | 2022.08.08 |
| iPhone에서 Objective-C를 사용한 메서드 이름 NSLogg (0) | 2022.08.08 |
| C/C++, 문자열 리터럴에 #파일을 포함할 수 있습니까? (0) | 2022.08.08 |
| Vue.js 데이터 인스턴스 내의 cytoscape 객체를 어떻게 저장합니까? (0) | 2022.08.08 |