@@ -19,6 +19,14 @@ export interface EditorOptions {
19
19
[ key : string ] : string ;
20
20
} ;
21
21
22
+ /**
23
+ * List of dependencies to add to the Stackblitz example.
24
+ * The key is the name of the dependency and the value is the version.
25
+ */
26
+ dependencies ?: {
27
+ [ key : string ] : string ;
28
+ }
29
+
22
30
/**
23
31
* `true` if `ion-app` and `ion-content` should automatically be injected into the
24
32
* Stackblitz example.
@@ -79,6 +87,7 @@ const openHtmlEditor = async (code: string, options?: EditorOptions) => {
79
87
dependencies = {
80
88
...dependencies ,
81
89
...JSON . parse ( package_json ) . dependencies ,
90
+ ...options ?. dependencies ,
82
91
} ;
83
92
} catch ( e ) {
84
93
console . error ( 'Failed to parse package.json contents' , e ) ;
@@ -130,6 +139,7 @@ const openAngularEditor = async (code: string, options?: EditorOptions) => {
130
139
'angular.json' : defaultFiles [ 9 ] ,
131
140
'tsconfig.json' : defaultFiles [ 10 ] ,
132
141
...options ?. files ,
142
+ ...options ?. dependencies ,
133
143
} ;
134
144
135
145
const package_json = defaultFiles [ 11 ] ;
@@ -144,6 +154,7 @@ const openAngularEditor = async (code: string, options?: EditorOptions) => {
144
154
dependencies = {
145
155
...dependencies ,
146
156
...JSON . parse ( package_json ) . dependencies ,
157
+ ...options ?. dependencies ,
147
158
} ;
148
159
} catch ( e ) {
149
160
console . error ( 'Failed to parse package.json contents' , e ) ;
@@ -183,6 +194,7 @@ const openReactEditor = async (code: string, options?: EditorOptions) => {
183
194
'package.json' : defaultFiles [ 4 ] ,
184
195
'package-lock.json' : defaultFiles [ 5 ] ,
185
196
...options ?. files ,
197
+ ...options ?. dependencies ,
186
198
'.stackblitzrc' : `{
187
199
"startCommand": "yarn run start"
188
200
}` ,
0 commit comments