0

私はRailsのアセットパイプラインを使用してすべてのCSS/JSを連結しています(ただし、使用している特定の連結方法はあまり違いがないかもしれません)。

私が抱えている問題は、jQuery UIにこれらすべての@importディレクティブがあるため、jQuery UIがインポートしたいCSSファイルのすべてに対して個別のHTTPリクエストを取得していることです。これは、多くのディレクティブです。これは、開発と本番の両方で発生しています。残りの連結は完全に機能しています。それはただのjQueryUIのものです。

application.cssそれが役立つなら、これが私のです:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the top of the
 * compiled file, but it's generally better to create a new file per style scope.
 *
 *= require_self
 *= require vendor
 *= require scaffold
 *= require main
 *= require clients
 *= require appointments
 *= require marketing
 *= require services
 *= require reports
 *= require calendar
 *= require products
 *= require stylists
 *= require brochure
*/

そして、私のjQuery UI CSSはすべて次の場所にありvendorます:

$ ll vendor/assets/stylesheets/jquery_ui/
total 216
drwxr-xr-x  18 jason  staff    612 Jun 21 11:48 .
drwxr-xr-x   5 jason  staff    170 Jun 21 11:42 ..
-rw-r--r--   1 jason  staff  35010 Mar 12 12:55 jquery-ui.css
-rw-r--r--   1 jason  staff   1064 Jun 21 11:48 jquery.ui.accordion.css
-rw-r--r--   1 jason  staff    290 Jun 21 11:48 jquery.ui.all.css
-rw-r--r--   1 jason  staff   1106 Mar 12 12:55 jquery.ui.autocomplete.css
-rw-r--r--   1 jason  staff    658 Jun 21 11:48 jquery.ui.base.css
-rw-r--r--   1 jason  staff   2470 Jun 21 11:48 jquery.ui.button.css
-rw-r--r--   1 jason  staff   1458 Mar 12 12:55 jquery.ui.core.css
-rw-r--r--   1 jason  staff   4045 Jun 21 11:43 jquery.ui.datepicker.css
-rw-r--r--   1 jason  staff   1357 Mar 12 12:55 jquery.ui.dialog.css
-rw-r--r--   1 jason  staff    356 Jun 21 11:48 jquery.ui.progressbar.css
-rw-r--r--   1 jason  staff   1170 Jun 21 11:48 jquery.ui.resizable.css
-rw-r--r--   1 jason  staff    322 Jun 21 11:48 jquery.ui.selectable.css
-rw-r--r--   1 jason  staff   1139 Jun 21 11:48 jquery.ui.slider.css
-rw-r--r--   1 jason  staff   1382 Mar 12 12:55 jquery.ui.tabs.css
-rw-r--r--   1 jason  staff  19141 Jun 20 22:38 jquery.ui.theme.css
drwxr-xr-x  18 jason  staff    612 Jun 21 11:48 minified

すべてのjQueryUIファイルを、期待どおりに連結するにはどうすればよいですか?

4

1 に答える 1

2

http://jqueryui.comからのjQueryUIのデフォルトのビルドでは、すべてのファイルが連結されます。cssフォルダではなく、フォルダからファイルを取得するようにしてdevelopment-bundleください。

于 2012-06-21T16:31:43.783 に答える