导入 gem 的依赖样式表?
Import a gem's dependency's stylesheet?
我正在为我们的多个应用程序构建共享样式表 gem。我们的应用程序目前 运行 bootstrap 3 通过 bootstrap-sass
gem。
我在我的 gem 中创建了一个 shared-styles.sass
文件,然后将其导入到我的应用程序的 application.sass
文件中。这一切都很好。
现在我正在尝试将 bootstrap-sass
gem 添加到我的共享样式表 gem 的 Gemfile
并将 bootstrap 导入 application.sass
或 shared-styles.sass
(似乎都不起作用)。这在我的应用程序中给出了 couldn't find file 'bootstrap'
。
这里的目标是不必在每个应用程序上安装 bootstrap 并让 gem 管理版本。
有没有办法与我的应用程序共享我的 gem 的依赖项?
在我的 Engine
class 中要求 gem 成功了!
module SharedStyles
class Railtie < ::Rails::Engine
require 'bootstrap-sass'
end
end
我正在为我们的多个应用程序构建共享样式表 gem。我们的应用程序目前 运行 bootstrap 3 通过 bootstrap-sass
gem。
我在我的 gem 中创建了一个 shared-styles.sass
文件,然后将其导入到我的应用程序的 application.sass
文件中。这一切都很好。
现在我正在尝试将 bootstrap-sass
gem 添加到我的共享样式表 gem 的 Gemfile
并将 bootstrap 导入 application.sass
或 shared-styles.sass
(似乎都不起作用)。这在我的应用程序中给出了 couldn't find file 'bootstrap'
。
这里的目标是不必在每个应用程序上安装 bootstrap 并让 gem 管理版本。
有没有办法与我的应用程序共享我的 gem 的依赖项?
在我的 Engine
class 中要求 gem 成功了!
module SharedStyles
class Railtie < ::Rails::Engine
require 'bootstrap-sass'
end
end