![](/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.