Commit 8c55e55 1 parent 32f5b35 commit 8c55e55 Copy full SHA for 8c55e55
File tree 5 files changed +118
-1
lines changed
5 files changed +118
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { mdsvex } from 'mdsvex'
2
+ const extension = [ '.md' , '.svx' , '.svelte' ]
3
+
4
+ /** @type {import('roxi')['RoxiPlugin'] } */
5
+ module . exports . default = {
6
+ name : 'mdsvex' ,
7
+ hooks : [
8
+ {
9
+ event : 'start' ,
10
+ action : app => app . config . mdsvex = { } , //provide an mdsvex object for developers to modify
11
+ } ,
12
+ {
13
+ event : 'before:bundle' ,
14
+ action : ( app , params ) => {
15
+ app . merge ( {
16
+ config : {
17
+ svelte : {
18
+ preprocess : [
19
+ mdsvex ( {
20
+ ...app . config . mdsvex ,
21
+ ...params
22
+ } )
23
+ ] ,
24
+ extensions : params . extension
25
+ || app . config . svelte . extensions
26
+ || app . config . mdsvex . extension
27
+ || extension
28
+ }
29
+ }
30
+ } )
31
+ }
32
+ }
33
+ ]
34
+ }
Original file line number Diff line number Diff line change
1
+ module . exports . default = [
2
+ {
3
+ type : 'multiSelect' ,
4
+ name : 'extensions' ,
5
+ message : 'Comma separated extensions to use for markdown' ,
6
+ hint : 'More extensions can be added in _roxi/roxi.config.yaml' ,
7
+ initial : [ '.md' , '.svx' ] ,
8
+ choices : [ '.md' , '.svx' ]
9
+ }
10
+ ]
Original file line number Diff line number Diff line change
1
+ export default {
2
+ dependencies : {
3
+ 'preprocess' : ( ) => import ( '../preprocess' )
4
+ } ,
5
+ hooks : [
6
+ {
7
+ event : 'start' ,
8
+ action : async ( app , params ) => {
9
+ app . merge ( {
10
+ config : {
11
+ postcss : {
12
+ plugins : [ ]
13
+ }
14
+ }
15
+ } )
16
+ }
17
+ } ,
18
+ {
19
+ event : 'before:bundle' ,
20
+ action : async ( app , params ) => {
21
+ const postcss = ( await import ( 'rollup-plugin-postcss' ) ) . default
22
+ const autoPreprocess = ( await import ( 'svelte-preprocess' ) ) . default
23
+ const postcssImport = ( await import ( 'postcss-import' ) ) . default
24
+ const postcssCfg = { plugins : [ postcssImport ( ) ] }
25
+
26
+ app . merge ( {
27
+ config : {
28
+ rollup : {
29
+ plugins : [
30
+ postcss ( postcssCfg )
31
+ ]
32
+ } ,
33
+ svelte : {
34
+ preprocess : [
35
+ autoPreprocess ( {
36
+ postcss : postcssCfg ,
37
+ defaults : { style : 'postcss' }
38
+ } )
39
+ ]
40
+ }
41
+ }
42
+ } )
43
+ }
44
+ }
45
+ ]
46
+ }
47
+
Original file line number Diff line number Diff line change
1
+ export default {
2
+ hooks : [
3
+ {
4
+ condition : 'start' ,
5
+ action : app => app . config . autoPreprocess = { }
6
+ } ,
7
+ {
8
+ condition : 'before:bundle' ,
9
+ action : async ( app , params ) => {
10
+ const autoPreprocess = ( await import ( 'svelte-preprocess' ) ) . default
11
+
12
+ app . merge ( {
13
+ config : {
14
+ svelte : {
15
+ preprocess : [
16
+ autoPreprocess ( app . config . autoPreprocess )
17
+ ]
18
+ }
19
+ }
20
+ } )
21
+ }
22
+ }
23
+ ]
24
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " roxi" ,
3
- "version" : " 1.3 .0" ,
3
+ "version" : " 1.4 .0" ,
4
4
"description" : " The framework that gets your rocks off" ,
5
5
"bin" : " lib/cli.js" ,
6
6
"main" : " roxi.js" ,
31
31
"express" : " ^4.17.1" ,
32
32
"fs-extra" : " ^9.0.1" ,
33
33
"jsondiffpatch" : " ^0.4.1" ,
34
+ "mdsvex" : " ^0.8.8" ,
34
35
"node-html-parser" : " ^1.2.20" ,
35
36
"nollup" : " ^0.13.11" ,
36
37
"ora" : " ^4.0.4" ,
43
44
"spassr" : " ^2.0.0" ,
44
45
"svelte" : " ^3.23.2" ,
45
46
"svelte-hmr" : " ^0.10.2" ,
47
+ "svelte-preprocess" : " ^4.3.1" ,
46
48
"svite" : " ^0.5.0" ,
47
49
"terminal-link" : " ^2.1.1" ,
48
50
"tree-kill" : " ^1.2.2" ,
You can’t perform that action at this time.
0 commit comments