宜しくお願い致します。
かなりはまってしまい質問させていただきました。
Rails4.2系 -> 5.1にアップデートして
webpacker gemを導入してみました。
テストサーバーにデプロイすると
既存のjavascriptが一部動かなくなりました。
テストサーバーはさくらのVPSを使っております。
▼ 動かない
- select2 (gem)
- juqery/widget/datepicker
▼ 動く
bootstrapのモーダルウィンドウ
consoleでのエラーはありません。
ローカルでは問題なく動きます。
以下に設定ファイルを記載します。
# app/assets/javascripts/application.js // about supported directives. // //= require jquery //= require jquery_ujs //= require jquery-ui/widgets/datepicker //= require bootstrap //= require select2 //= require_tree .
# config/webpack/development.js const environment = require('./environment') module.exports = environment.toWebpackConfig()
# config/webpack/staging.js const environment = require('./environment') module.exports = environment.toWebpackConfig()
# webpacker/yml # Note: You must restart bin/webpack-dev-server for changes to take effect default: &default source_path: app/javascript source_entry_path: packs public_output_path: packs cache_path: tmp/cache/webpacker # Additional paths webpack should lookup modules # ['app/assets', 'engine/foo/app/assets'] resolved_paths: [] # Reload manifest.json on all requests so we reload latest compiled packs cache_manifest: false extensions: - .coffee - .erb - .js - .jsx - .ts - .vue - .sass - .scss - .css - .png - .svg - .gif - .jpeg - .jpg development: <<: *default compile: true # Reference: https://webpack.js.org/configuration/dev-server/ dev_server: https: false host: localhost port: 3035 public: localhost:3035 hmr: false # Inline should be set to true if using HMR inline: true overlay: true disable_host_check: true use_local_ip: false staging: <<: *ndefault # Production depends on precompilation of packs prior to booting for performance. compile: false # Cache manifest.json for performance cache_manifest: true
必要なjsをwebpacker管理にすれば解決するかもしれませんが、
「ローカルで動いてサーバーで動かない理由」
がきになって投稿いたしました。
お知恵を拝借できれば助かります。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。