ember-cli-rails-assets 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -3
- data/app/helpers/ember_cli_rails_assets_helper.rb +16 -2
- data/lib/ember_cli/assets/errors.rb +1 -0
- data/lib/ember_cli/assets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f38df79bd5263f5e6d124fd2ddeff3e0f724a6a967e1c165d4799a946f557c51
|
|
4
|
+
data.tar.gz: 36afc4bff115269fa3cb626e5d52aed8f8a8cddfb09b13b8e621602a9b72ec3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '084c574b46d27829d332586bd8e3766ab3e4a1205a373d1c2d1b2a9e2f89e1924393b22b1ed418021e3c30e047ae92357b06c72d89bb5e6b796ec51f7693589c'
|
|
7
|
+
data.tar.gz: 521eee2cc26d824b6e6862b428213cfdd2b1f8bb2827c366d7a0b59688d066818d991a0b9e27065771d1c118a868247a47cf1b301da6cafad1f325c4b0679261
|
data/README.md
CHANGED
|
@@ -33,8 +33,9 @@ $ bundle install
|
|
|
33
33
|
To configure your project to use `ember-cli-rails`, follow the instructions
|
|
34
34
|
listed in the [`ember-cli-rails` README][README].
|
|
35
35
|
|
|
36
|
-
To configure
|
|
37
|
-
|
|
36
|
+
To configure a classic (Broccoli-based) Ember application to use
|
|
37
|
+
`ember-cli-rails-assets`, ensure its `ember-cli-build.js` includes the
|
|
38
|
+
following values:
|
|
38
39
|
|
|
39
40
|
```js
|
|
40
41
|
// frontend/ember-cli-build.js
|
|
@@ -54,6 +55,21 @@ module.exports = function(defaults) {
|
|
|
54
55
|
|
|
55
56
|
[README]: https://github.com/tricknotes/ember-cli-rails#readme
|
|
56
57
|
|
|
58
|
+
### Vite-based applications
|
|
59
|
+
|
|
60
|
+
Vite-based applications (generated with `ember-cli >= 6.8`) require no build
|
|
61
|
+
configuration. For them, use `include_ember_script_tags` on its own: it emits
|
|
62
|
+
everything the application needs to boot — the configuration `<meta>` tag, the
|
|
63
|
+
stylesheet and `modulepreload` links, and the ES module script tags —
|
|
64
|
+
extracted from the generated `index.html`:
|
|
65
|
+
|
|
66
|
+
```erb
|
|
67
|
+
<%= include_ember_script_tags :frontend %>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`include_ember_stylesheet_tags` only supports classic applications, and raises
|
|
71
|
+
an error when called for a Vite-based application.
|
|
72
|
+
|
|
57
73
|
## Mount
|
|
58
74
|
|
|
59
75
|
Mount the Ember application (in this example, the `frontend` application) to the
|
|
@@ -126,7 +142,9 @@ path to prepend:
|
|
|
126
142
|
|
|
127
143
|
This project supports:
|
|
128
144
|
|
|
129
|
-
* EmberCLI versions `>= 1.13.13`
|
|
145
|
+
* EmberCLI versions `>= 1.13.13` using the classic (Broccoli-based) build
|
|
146
|
+
* EmberCLI versions `>= 6.8` using the Vite-based build, with
|
|
147
|
+
`include_ember_script_tags` only
|
|
130
148
|
|
|
131
149
|
## Ruby and Rails support
|
|
132
150
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require "ember_cli/assets/errors"
|
|
1
2
|
require "ember_cli/assets/lookup"
|
|
2
3
|
require "ember_cli/assets/paths"
|
|
3
4
|
|
|
@@ -16,9 +17,22 @@ module EmberCliRailsAssetsHelper
|
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def include_ember_stylesheet_tags(name, prepend: "")
|
|
19
|
-
EmberCli[name]
|
|
20
|
+
app = EmberCli[name]
|
|
21
|
+
app.build
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
paths = EmberCli::Assets::Paths.new(app)
|
|
24
|
+
|
|
25
|
+
if paths.vite?
|
|
26
|
+
raise EmberCli::Assets::NotSupportedError, <<~MSG
|
|
27
|
+
`include_ember_stylesheet_tags` does not support Vite-based
|
|
28
|
+
applications (`ember-cli >= 6.8`).
|
|
29
|
+
|
|
30
|
+
`include_ember_script_tags` already emits their stylesheet tags,
|
|
31
|
+
so remove this call.
|
|
32
|
+
MSG
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
assets = EmberCli::Assets::Lookup.new(app)
|
|
22
36
|
|
|
23
37
|
assets.stylesheet_assets.
|
|
24
38
|
map { |src| [prepend, src].join }.
|