![](/img/trans.png)
[英]An error happens in webpack production mode, but but works well at development mode
[英]Included jQuery not works under production mode raise `is not a function` error
我將jquery.placeholder.js
放在assets/javascripts
文件夾下
然后在我的coffeescript文件中應用該功能,即可正常工作。
$(document).ready ->
$('input, textarea').placeholder();
但是,當我通過RAILS_ENV=production rails s
在生產模式下運行時
在Firebug控制台上引發not a function error
我把其他相關文件放在要點上
取消注釋行:config / enviroments / production.rb中為50,並在其中添加jquery.placeholder.js
以對其進行預編譯
config.assets.precompile += %w( jquery.placeholder.js )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.