Class: EmberCli::Assets::Paths
- Inherits:
-
Object
- Object
- EmberCli::Assets::Paths
- Defined in:
- lib/ember_cli/assets/paths.rb
Instance Method Summary collapse
- #asset_map ⇒ Object
- #assets ⇒ Object
- #index_html ⇒ Object
-
#initialize(app) ⇒ Paths
constructor
A new instance of Paths.
- #package_json ⇒ Object
-
#vite? ⇒ Boolean
Vite builds (ember-cli >= 6.8) boot from ES modules in index.html, while classic builds emit plain script tags.
Constructor Details
#initialize(app) ⇒ Paths
Returns a new instance of Paths.
6 7 8 |
# File 'lib/ember_cli/assets/paths.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#asset_map ⇒ Object
14 15 16 |
# File 'lib/ember_cli/assets/paths.rb', line 14 def asset_map Pathname.glob(assets.join("assetMap*.json")).first end |
#assets ⇒ Object
10 11 12 |
# File 'lib/ember_cli/assets/paths.rb', line 10 def assets app.dist_path.join("assets") end |
#index_html ⇒ Object
22 23 24 |
# File 'lib/ember_cli/assets/paths.rb', line 22 def index_html app.dist_path.join("index.html") end |
#package_json ⇒ Object
18 19 20 |
# File 'lib/ember_cli/assets/paths.rb', line 18 def package_json app.root_path.join("package.json") end |
#vite? ⇒ Boolean
Vite builds (ember-cli >= 6.8) boot from ES modules in index.html, while classic builds emit plain script tags.
28 29 30 31 |
# File 'lib/ember_cli/assets/paths.rb', line 28 def vite? index_html.exist? && !Nokogiri::HTML5(index_html.read).at_css('script[type="module"]').nil? end |