課程
/前端開發(fā)
/前端工具
/webpack深入與實(shí)戰(zhàn)
require is not defined ?是什么原因呢
2019-02-19
源自:webpack深入與實(shí)戰(zhàn) 1-2
正在回答
錯(cuò)誤原因: 瀏覽器端不能識(shí)別require關(guān)鍵字。你可能是在ES5語法下使用了其他js語法(如node,ES6,commn)導(dǎo)致無法識(shí)別。(tip:瀏覽器識(shí)別ES5)
解決方式:使用webpack編譯一下就可以了。 (webpack <filename>.js? bundle.js)
舉報(bào)
webpack實(shí)戰(zhàn)教程,用真實(shí)項(xiàng)目帶你探索 webpack 強(qiáng)大的功能
4 回答仍然報(bào)錯(cuò) _dirname is not defined
3 回答ERROR in Template execution failed: ReferenceError: htmlPlugin is not defined這是什么原因
1 回答TypeError:template.indexof is not a function
4 回答layer is not a constructor 問題
3 回答ERROR in ./src/css/common.css Module build failed: TypeError: loaderUtils.getOptions is not a function
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2019-02-24
錯(cuò)誤原因: 瀏覽器端不能識(shí)別require關(guān)鍵字。你可能是在ES5語法下使用了其他js語法(如node,ES6,commn)導(dǎo)致無法識(shí)別。(tip:瀏覽器識(shí)別ES5)
解決方式:使用webpack編譯一下就可以了。 (webpack <filename>.js? bundle.js)