Vue.js 2.0 모듈 빌드 실패:구문 오류:웹 팩, Elixir 및 꿀꺽을 사용한 예상치 못한 토큰
Vue.js 1.X에서 Vue.js 2.0으로 업그레이드하려고 거의 하루를 보냈는데도 여전히 오류가 발생하고 있다(꿀벌워치 사용)
./~/buble-loader!/~/vue-loader/lib/lib/lib.js?type=script&index=0!/cs/changes/js/changes/changes/changes/changes.vue 모듈 빌드 실패:구문 오류:Unexpected token (41:79) at Parser.pp$4.raise (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:2221:15) at Parser.pp.unexpected (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:603:10) at Parser.pp$3.parseExprAtom (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1822:12) at Parser.parseExprAtom (/home/vagrant/Projects/test/node_modules/buble/dist/buble.umd.js:656:26) at Parser.pp$3.parseExprSubscripts (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1715:21) at Parser.pp$3.parseMaybeUnary (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1692:19) at Parser.pp$3.parseExprOps (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1637:21) at Parser.pp$3.parseMaybeConditional (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1620:21) at Parser.pp$3.parseMaybeAssign (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1597:21) at Parser.pp$3.parseMaybeAssign (/home/vagrant/Projects/test/node_modules/acorn/dist/acorn.js:1608:25) @ ./resources/assets/js/js/sexplevue 7:18-16 @ ./~~/버블 로더!/~/vue-loader/lib/lib/lib.js?type=script&index=0!/resource/assets/js/components/예:Parent.vue @ ./resource/assets/js/components/예:Parent.vue @ ./filename/js/app.js
여러 번 설치를 시도했지만 다음 패키지로 종료됨
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"dependencies": {
"babel-core": "^6.18.0",
"babel-loader": "^6.2.7",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-runtime": "^6.18.0",
"bootstrap": "^3.3.7",
"bootstrap-switch": "^3.3.2",
"css-loader": "^0.25.0",
"lodash": "^4.14.0",
"vue": "^2.0.3",
"vue-hot-reload-api": "^2.0.6",
"vue-html-loader": "^1.2.3",
"vue-loader": "^9.7.0",
"vue-resource": "^1.0.3",
"vue-strap": "^1.1.18"
},
"devDependencies": {
"babel-preset-es2015": "6.9.0",
"bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1",
"install": "^0.8.2",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.9",
"npm": "^3.10.9",
"vue-router": "^2.0.1"
}
}
내 꿀벌은 마치
const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
elixir(mix => {
mix.sass('app.scss')
.webpack('app.js')
.webpack('backend.js')
// other stuff. . . //
}
문제가 뭐죠?이 반복되는 오류를 어떻게 해결할 것인가?
첫째, 예상치 못한 토큰에 오류가 발생할 때마다...9/10 구문 오류.그러니 네 본보기로 들어가 봐.방법이나 계산 또는 데이터 후에 결장이 누락되었는지 확인하십시오.그래서 이 오류는 확실히 에 있다.resources/assets/js/components/example/example.vue
40호선 근처 어딘가에둘째로, 웹 팩으로 무엇을 달성하려고 하는지 잘 모르겠지만 스크립트를 하나로 결합하고 싶다면 웹 팩은 다음과 같은 일련의 스크립트를 수락할 것이다.
.webpack([
'app.js',
'scripts/choose-language.js'
])
두 번째 매개 변수를 사용하여 출력 스크립트 파일 이름을 지정할 수도 있다.
'IT이야기' 카테고리의 다른 글
Vuex 상태 변경으로 인해 구성 요소가 다시 렌더링되지 않음 (0) | 2022.05.03 |
---|---|
Vue.js Safari 모바일 및 호환성 (0) | 2022.05.03 |
변수 선언 이전과 루프 내 간의 차이? (0) | 2022.05.03 |
C 또는 C++의 좋은 gotos 예 (0) | 2022.05.03 |
Java 동기화된 메서드 잠금 객체 또는 메서드? (0) | 2022.05.03 |