File tree Expand file tree Collapse file tree 8 files changed +39
-21
lines changed
example_engine/app/frontend Expand file tree Collapse file tree 8 files changed +39
-21
lines changed Original file line number Diff line number Diff line change 99
99
ffi (1.15.3 )
100
100
globalid (0.5.2 )
101
101
activesupport (>= 5.0 )
102
- i18n (1.8.10 )
102
+ i18n (1.8.11 )
103
103
concurrent-ruby (~> 1.0 )
104
104
jbuilder (2.11.2 )
105
105
activesupport (>= 5.0.0 )
108
108
listen (3.6.0 )
109
109
rb-fsevent (~> 0.10 , >= 0.10.3 )
110
110
rb-inotify (~> 0.9 , >= 0.9.10 )
111
- loofah (2.12 .0 )
111
+ loofah (2.13 .0 )
112
112
crass (~> 1.0.2 )
113
113
nokogiri (>= 1.5.9 )
114
114
mail (2.7.1 )
117
117
method_source (1.0.0 )
118
118
mini_mime (1.1.0 )
119
119
mini_portile2 (2.6.1 )
120
- minitest (5.14.4 )
120
+ minitest (5.15.0 )
121
121
msgpack (1.4.2 )
122
122
nio4r (2.5.8 )
123
123
nokogiri (1.12.5 )
@@ -209,12 +209,12 @@ GEM
209
209
turbolinks-source (5.2.0 )
210
210
tzinfo (2.0.4 )
211
211
concurrent-ruby (~> 1.0 )
212
- vite_plugin_legacy (3.0.0 )
213
- vite_ruby (~> 3.0 )
214
- vite_rails (3.0.1 )
212
+ vite_plugin_legacy (3.0.2 )
213
+ vite_ruby (~> 3.0 , >= 3.0.4 )
214
+ vite_rails (3.0.3 )
215
215
railties (>= 5.1 , < 8 )
216
216
vite_ruby (~> 3.0 )
217
- vite_ruby (3.0.2 )
217
+ vite_ruby (3.0.6 )
218
218
dry-cli (~> 0.7.0 )
219
219
rack-proxy (~> 0.6 , >= 0.6.1 )
220
220
zeitwerk (~> 2.2 )
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import '~/styles/theme.css'
13
13
import '~/entrypoints/example_import.js'
14
14
import '~/outer_import.js'
15
15
16
+ // Example: Import from an aliased path.
17
+ import '@administrator/timer'
18
+
16
19
// Import all channels.
17
20
import . meta. globEager ( '../channels/**/*_channel.js' )
18
21
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ ViteRuby . env [ 'ADMINISTRATOR_ASSETS_PATH' ] =
4
+ "#{ Gem . loaded_specs [ 'administrator' ] . full_gem_path } /app/frontend"
Original file line number Diff line number Diff line change 1
- function startTimer ( timer , loadedAt = new Date ( ) . getTime ( ) ) {
2
- function updateTimer ( ) {
3
- const millisEllapsed = new Date ( ) . getTime ( ) - loadedAt
4
- timer . innerHTML = Math . floor ( millisEllapsed / 1000 )
5
- }
6
-
7
- setInterval ( updateTimer , 200 )
8
- }
1
+ import { startTimer } from '~/timer'
9
2
10
3
document . addEventListener ( 'DOMContentLoaded' , ( ) => {
11
4
console . log ( 'Vite ⚡️ Rails: Engine' )
12
5
startTimer ( document . getElementById ( 'timer' ) )
13
6
} )
14
-
Original file line number Diff line number Diff line change
1
+ export function startTimer ( timer , loadedAt = new Date ( ) . getTime ( ) ) {
2
+ function updateTimer ( ) {
3
+ const millisEllapsed = new Date ( ) . getTime ( ) - loadedAt
4
+ timer . innerHTML = Math . floor ( millisEllapsed / 1000 )
5
+ }
6
+
7
+ setInterval ( updateTimer , 200 )
8
+ }
Original file line number Diff line number Diff line change 28
28
"vite-plugin-bugsnag" : " ^1.0.2" ,
29
29
"vite-plugin-environment" : " ^1.0.0" ,
30
30
"vite-plugin-full-reload" : " ^0.2" ,
31
- "vite-plugin-ruby" : " ^3.0.3 " ,
31
+ "vite-plugin-ruby" : " ^3.0.5 " ,
32
32
"vite-plugin-windicss" : " ^0.9"
33
33
}
34
34
}
Original file line number Diff line number Diff line change @@ -41,4 +41,15 @@ export default defineConfig({
41
41
} ,
42
42
} ) ,
43
43
] ,
44
+ // Example: Importing assets from arbitrary paths.
45
+ resolve : {
46
+ alias : {
47
+ '@administrator/' : `${ process . env . ADMINISTRATOR_ASSETS_PATH } /` ,
48
+ } ,
49
+ } ,
50
+ server : {
51
+ fs : {
52
+ allow : [ process . env . ADMINISTRATOR_ASSETS_PATH ! ] ,
53
+ } ,
54
+ } ,
44
55
} )
Original file line number Diff line number Diff line change @@ -2244,10 +2244,10 @@ vite-plugin-full-reload@^0.2:
2244
2244
chalk "^4.1"
2245
2245
picomatch "^2.2.2"
2246
2246
2247
- vite-plugin-ruby@^3.0.3 :
2248
- version "3.0.3 "
2249
- resolved "https://registry.yarnpkg.com/vite-plugin-ruby/-/vite-plugin-ruby-3.0.3 .tgz#e5fcbeaafe28c4b2a448af3a20fcbaa44c81d6b9 "
2250
- integrity sha512-RZMYOmhGwWwyDh00YIwKV2tO377Pqeke1bk3XJS5hBRGUnS5qgHLp6bqZH9yeLCxmlJ5kgWUzNkDmDDhV2BmNQ ==
2247
+ vite-plugin-ruby@^3.0.5 :
2248
+ version "3.0.5 "
2249
+ resolved "https://registry.yarnpkg.com/vite-plugin-ruby/-/vite-plugin-ruby-3.0.5 .tgz#b2601f832e043e023a07cea5a3bd87d24a8a1562 "
2250
+ integrity sha512-bFPnLxWxF1SyWtag24f48hYqLu0dydDs8tuIlvY60uHOY4yj6syCybZY21k3B9EgVtdGLve5twduj9bIoDuSug ==
2251
2251
dependencies :
2252
2252
debug "^4.3.1"
2253
2253
fast-glob "^3.2.4"
You can’t perform that action at this time.
0 commit comments