49
49
50
50
Ƭ ** AbstractPath** : { toString: () => string }
51
51
52
- * Defined in [ types.ts:32] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L32 ) *
52
+ * Defined in [ types.ts:32] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L32 ) *
53
53
54
54
An abstract way to specify a path. It could be a simple string or a object like an URL. An AbstractPath must always be convertible to a string.
55
55
65
65
66
66
Ƭ ** Cache** : { get: (key: string) => Promise<string \| undefined\> ; set: (key: string, value: string) => Promise<void\> }
67
67
68
- * Defined in [ types.ts:20] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L20 ) *
68
+ * Defined in [ types.ts:20] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L20 ) *
69
69
70
70
#### Type declaration:
71
71
80
80
81
81
Ƭ ** ContentData** : string \| ArrayBuffer
82
82
83
- * Defined in [ types.ts:71] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L71 ) *
83
+ * Defined in [ types.ts:71] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L71 ) *
84
84
85
85
___
86
86
87
87
### CustomBlock
88
88
89
89
Ƭ ** CustomBlock** : { attrs: Record<string, string \| true\> ; content: string ; type: string }
90
90
91
- * Defined in [ types.ts:109] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L109 ) *
91
+ * Defined in [ types.ts:109] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L109 ) *
92
92
93
93
A custom block
94
94
106
106
107
107
Ƭ ** CustomBlockCallback** : (component: [ ModuleExport] ( README.md#moduleexport ) ) => void
108
108
109
- * Defined in [ types.ts:103] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L103 ) *
109
+ * Defined in [ types.ts:103] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L103 ) *
110
110
111
111
CustomBlockCallback function type
112
112
116
116
117
117
Ƭ ** File** : { getContentData: (asBinary: Boolean) => Promise<[ ContentData] ( README.md#contentdata ) \> ; type: string }
118
118
119
- * Defined in [ types.ts:77] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L77 ) *
119
+ * Defined in [ types.ts:77] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L77 ) *
120
120
121
121
Represents a file content and the extension name.
122
122
@@ -133,15 +133,15 @@ ___
133
133
134
134
Ƭ ** LangProcessor** : (source: string, preprocessOptions?: any) => Promise<string\> \| string
135
135
136
- * Defined in [ types.ts:429] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L429 ) *
136
+ * Defined in [ types.ts:429] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L429 ) *
137
137
138
138
___
139
139
140
140
### Module
141
141
142
142
Ƭ ** Module** : { exports: [ ModuleExport] ( README.md#moduleexport ) }
143
143
144
- * Defined in [ types.ts:128] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L128 ) *
144
+ * Defined in [ types.ts:128] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L128 ) *
145
145
146
146
This just represents a loaded js module
147
147
@@ -157,15 +157,15 @@ ___
157
157
158
158
Ƭ ** ModuleCacheId** : string
159
159
160
- * Defined in [ types.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L26 ) *
160
+ * Defined in [ types.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L26 ) *
161
161
162
162
___
163
163
164
164
### ModuleExport
165
165
166
166
Ƭ ** ModuleExport** : {} \| null
167
167
168
- * Defined in [ types.ts:123] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L123 ) *
168
+ * Defined in [ types.ts:123] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L123 ) *
169
169
170
170
This just represents a loaded js module exports
171
171
175
175
176
176
Ƭ ** ModuleHandler** : (type: string, getContentData: File[ \" getContentData\" ] , path: [ AbstractPath] ( README.md#abstractpath ) , options: [ Options] ( README.md#options ) ) => Promise<[ ModuleExport] ( README.md#moduleexport ) \| null\>
177
177
178
- * Defined in [ types.ts:68] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L68 ) *
178
+ * Defined in [ types.ts:68] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L68 ) *
179
179
180
180
Used by the library when it needs to handle a does not know how to handle a given file type (eg. ` .json ` files).
181
181
200
200
201
201
Ƭ **Options**: { additionalBabelParserPlugins?: babel\_ParserPlugin[] ; additionalBabelPlugins?: Record<string, any\> ; compiledCache?: [Cache](README.md#cache) ; delimiters?: [string, string] ; devMode?: boolean ; handleModule?: [ModuleHandler](README.md#modulehandler) ; isCustomElement: (tag: string) => boolean \| undefined ; moduleCache: Record<[ModuleCacheId](README.md#modulecacheid), LoadingType<[ModuleExport](README.md#moduleexport)\> \| [ModuleExport](README.md#moduleexport)\> ; pathResolve: [PathResolve](README.md#pathresolve) ; whitespace?: \"preserve\" \| \"condense\" ; addStyle: (style: string, scopeId: string \| undefined) => void ; createCJSModule: (refPath: [AbstractPath](README.md#abstractpath), source: string, options: [Options](README.md#options)) => [Module](README.md#module) ; customBlockHandler?: (block: [CustomBlock](README.md#customblock), filename: [AbstractPath](README.md#abstractpath), options: [Options](README.md#options)) => Promise<[CustomBlockCallback](README.md#customblockcallback) \| undefined\> ; getFile: (path: [AbstractPath](README.md#abstractpath)) => Promise<[File](README.md#file) \| [ContentData](README.md#contentdata)\> ; getResource: (pathCx: [PathContext](README.md#pathcontext), options: [Options](README.md#options)) => [Resource](README.md#resource) ; loadModule?: (path: [AbstractPath](README.md#abstractpath), options: [Options](README.md#options)) => Promise<[ModuleExport](README.md#moduleexport) \| undefined\> ; log?: (type: string, ...data: any[]) => void }
202
202
203
- * Defined in [ types.ts:139] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L139 ) *
203
+ * Defined in [ types.ts:139] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L139 ) *
204
204
205
205
#### Type declaration:
206
206
230
230
231
231
Ƭ ** PathContext** : { refPath: [ AbstractPath] ( README.md#abstractpath ) \| undefined ; relPath: [ AbstractPath] ( README.md#abstractpath ) }
232
232
233
- * Defined in [ types.ts:41] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L41 ) *
233
+ * Defined in [ types.ts:41] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L41 ) *
234
234
235
235
A PathContext represents a path (relPath) relative to an abolute path (refPath)
236
236
Note that relPath is not necessary relative, but when it is, relPath is relative to refPath.
248
248
249
249
Ƭ ** PathResolve** : (pathCx: [ PathContext] ( README.md#pathcontext ) ) => [ AbstractPath] ( README.md#abstractpath )
250
250
251
- * Defined in [ types.ts:50] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L50 ) *
251
+ * Defined in [ types.ts:50] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L50 ) *
252
252
253
253
relative to absolute module path resolution
254
254
258
258
259
259
Ƭ ** Resource** : { getContent: () => Promise<[ File] ( README.md#file ) \> ; id: [ ModuleCacheId] ( README.md#modulecacheid ) ; path: [ AbstractPath] ( README.md#abstractpath ) }
260
260
261
- * Defined in [ types.ts:88] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/types.ts#L88 ) *
261
+ * Defined in [ types.ts:88] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/types.ts#L88 ) *
262
262
263
263
Represents a resource.
264
264
@@ -276,9 +276,9 @@ Name | Type | Description |
276
276
277
277
• ` Const ` ** version** : string = process.env.VERSION as string
278
278
279
- * Defined in [ tools.ts:49] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/tools.ts#L49 ) *
279
+ * Defined in [ tools.ts:49] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/tools.ts#L49 ) *
280
280
281
- * Defined in [ index.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L26 ) *
281
+ * Defined in [ index.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L26 ) *
282
282
283
283
the version of the library (process.env.VERSION is set by webpack, at compile-time)
284
284
288
288
289
289
• ` Const ` ** vueVersion** : string = process.env.VUE\_ VERSION as string
290
290
291
- * Defined in [ index.ts:32] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L32 ) *
291
+ * Defined in [ index.ts:32] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L32 ) *
292
292
293
293
the version of Vue that is expected by the library
294
294
@@ -298,7 +298,7 @@ the version of Vue that is expected by the library
298
298
299
299
▸ ** buildTemplateProcessor** (` processor ` : [ LangProcessor] ( README.md#langprocessor ) ): object
300
300
301
- * Defined in [ index.ts:194] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L194 ) *
301
+ * Defined in [ index.ts:194] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L194 ) *
302
302
303
303
Convert a function to template processor interface (consolidate)
304
304
320
320
321
321
▸ ** createSFCModule** (` source ` : string, ` filename ` : [ AbstractPath] ( README.md#abstractpath ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
322
322
323
- * Defined in [ createSFCModule.ts:3] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/createSFCModule.ts#L3 ) *
323
+ * Defined in [ createSFCModule.ts:3] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/createSFCModule.ts#L3 ) *
324
324
325
325
#### Parameters:
326
326
338
338
339
339
▸ ** defaultGetResource** (` pathCx ` : [ PathContext] ( README.md#pathcontext ) , ` options ` : [ Options] ( README.md#options ) ): [ Resource] ( README.md#resource )
340
340
341
- * Defined in [ index.ts:74] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L74 ) *
341
+ * Defined in [ index.ts:74] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L74 ) *
342
342
343
343
Default getResource implementation
344
344
by default, getContent() use the file extension as file type.
358
358
359
359
▸ ** defaultHandleModule** (` type ` : string, ` getContentData ` : File[ \" getContentData\" ] , ` path ` : [ AbstractPath] ( README.md#abstractpath ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \| undefined\>
360
360
361
- * Defined in [ tools.ts:399] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/tools.ts#L399 ) *
361
+ * Defined in [ tools.ts:399] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/tools.ts#L399 ) *
362
362
363
363
Default implementation of handleModule
364
364
379
379
380
380
▸ ` Const ` ** defaultPathResolve** (` __namedParameters ` : { refPath: [ AbstractPath] ( README.md#abstractpath ) ; relPath: [ AbstractPath] ( README.md#abstractpath ) }): string \| [ AbstractPath] ( README.md#abstractpath )
381
381
382
- * Defined in [ index.ts:51] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L51 ) *
382
+ * Defined in [ index.ts:51] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L51 ) *
383
383
384
384
Default resolve implementation
385
385
resolve() should handle 3 situations :
401
401
402
402
▸ ** loadModule** (` path ` : [ AbstractPath] ( README.md#abstractpath ) , ` options? ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
403
403
404
- * Defined in [ index.ts:155] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/index.ts#L155 ) *
404
+ * Defined in [ index.ts:155] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/index.ts#L155 ) *
405
405
406
406
This is the main function.
407
407
This function is intended to be used only to load the entry point of your application.
455
455
456
456
▸ ** loadModuleInternal** (` pathCx ` : [ PathContext] ( README.md#pathcontext ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
457
457
458
- * Defined in [ tools.ts:276] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/tools.ts#L276 ) *
458
+ * Defined in [ tools.ts:276] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/tools.ts#L276 ) *
459
459
460
460
#### Parameters:
461
461
@@ -472,6 +472,6 @@ Name | Type |
472
472
473
473
▪ ` Const ` ** targetBrowserBabelPlugins** : object
474
474
475
- * Defined in [ tools.ts:211] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/ff21419 /src/tools.ts#L211 ) *
475
+ * Defined in [ tools.ts:211] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/7d22827 /src/tools.ts#L211 ) *
476
476
477
477
#### Properties:
0 commit comments