我越來越
index.js:978 TypeError: __webpack_require__(...).context is not a function
at eval (index.vue:20)
at Object.dqAR (pages-investment-pages-home-index.js:348)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (null:1)
at Module.Hi1e (pages-investment-pages-home-index.js:177)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (null:1)
at Module.bE2I (pages-investment-pages-home-index.js:320)
這是我的代碼
const path = './'
require.context(path,false,/\.js$/)
看起來 require.context 的引數不能是變數。因為當我這樣使用時,它作業正常:
require.context('./',false,/\.js$/)
我對此感到困惑。
是因為這個函式屬于 webpack 并且它在編譯之前運行?
謝謝你的回答。
uj5u.com熱心網友回復:
傳遞給的引數require.context 
使用生成的變數無效__webpack_require__:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/406595.html
標籤:
