rails scss资产被导入两次

时间:2016-02-19 00:23:22

标签: css ruby-on-rails twitter-bootstrap sass sprockets

我正在研究一个我没写过的Rails应用程序,并且我意识到已编译的样式表包含两次Bootstrap CSS。这两个截图来自同一个文件,编译后的/ assets / application-2d2c43940p [...]。css

File As: IIF([Owner] IS NOT NULL, [OWNER], 
             IIF([BusinessName] IS NOT NULL, [BusinessName], 
                 IIF([TribeName] IS NOT NULL, [TribeName], NULL)))

/*
 * 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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *'
 *= require normalize
 *= require jquery.tagit
 *= require tagit.ui-zendesk
 *= require bootstrap-datepicker
 *= require_tree .
 *= require_self
 */
/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/* line 9, /home/michael/.rvm/gems/ruby-2.2.2@gradready/gems/bootstrap-sass-3.3.5.1/assets/stylesheets/bootstrap/_normalize.scss */
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

请注意,require语句在第二个副本中被删除。但是,如果我搜索Bootstrap,它只会在application.scss文件中出现一次,如下图所示。为什么会发生这种情况?

/*
 * 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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *'






 */
/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/* line 9, /home/michael/.rvm/gems/ruby-2.2.2@gradready/gems/bootstrap-sass-3.3.5.1/assets/stylesheets/bootstrap/_normalize.scss */
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

另外,我的应用程序.scss,即我自己编写的代码,只出现过一次。它似乎只是一些库被导入两次。

0 个答案:

没有答案