es6 가져 오기를 사용하기 위해 require.js를 사용하는 이전 응용 프로그램을 다시 작성하려고합니다. 사용 된 라이브러리 중 하나는 Backbone과 Underscore입니다. 하나의 큰 묶음을 만들고 es6를 es5로 사전 컴파일하려면 Webpack을 babel-loader와 함께 사용합니다. 번들이 생성됩니다하지만 브라우저에서로드 할 때 나는 다음과 같은 오류가 점점 오전 :Webpack을 번들링 할 때 밑줄이 잘못되었습니다.
Uncaught TypeError: Cannot read property '_' of undefined
root._ 나에게 오류를 제공, 그래서 '이'가 밑줄에서 만든 bundle.js에 정의되지 않은 것 같다.
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {}
아무도 같은 문제가 있습니까?
'babel-loader' 웹팩 설정이란 무엇입니까? 'exclude :/node_modules /'라인을 따라 뭔가 빠졌을 것입니다. – loganfsmyth
Tnx 많이! 'babel-loader' webpack 설정에'exclude :/node_modules /'를 추가하면 문제가 해결되었습니다! –