課程
/前端開發
/前端工具
/webpack深入與實戰
require is not defined ?是什么原因呢
2019-02-19
源自:webpack深入與實戰 1-2
正在回答
錯誤原因: 瀏覽器端不能識別require關鍵字。你可能是在ES5語法下使用了其他js語法(如node,ES6,commn)導致無法識別。(tip:瀏覽器識別ES5)
解決方式:使用webpack編譯一下就可以了。 (webpack <filename>.js? bundle.js)
舉報
webpack實戰教程,用真實項目帶你探索 webpack 強大的功能
4 回答仍然報錯 _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號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-02-24
錯誤原因: 瀏覽器端不能識別require關鍵字。你可能是在ES5語法下使用了其他js語法(如node,ES6,commn)導致無法識別。(tip:瀏覽器識別ES5)
解決方式:使用webpack編譯一下就可以了。 (webpack <filename>.js? bundle.js)