File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -2,34 +2,25 @@ import path from 'path';
2
2
import { OptionConf , Webpack , ModuleScopePluginOpts , LoaderOneOf } from 'kkt' ;
3
3
import webpack from 'webpack' ;
4
4
5
- export const loaderOneOf = [
6
- require . resolve ( '@kkt/loader-less' )
5
+ export const loaderOneOf : LoaderOneOf = [
6
+ require . resolve ( '@kkt/loader-less' ) ,
7
+ require . resolve ( '@kkt/loader-raw' )
7
8
] ;
8
9
9
- export const moduleScopePluginOpts = [
10
+ export const moduleScopePluginOpts : ModuleScopePluginOpts = [
10
11
path . resolve ( process . cwd ( ) , 'README.md' )
11
12
] ;
12
13
13
14
export default ( conf : webpack . Configuration , opts : OptionConf , webpack : Webpack ) => {
14
15
const pkg = require ( path . resolve ( process . cwd ( ) , 'package.json' ) ) ;
15
- // Webpack parses md file text
16
- conf . module ! . rules . map ( ( item ) => {
17
- if ( item . oneOf ) {
18
- item . oneOf . unshift ( {
19
- test : / \. m d $ / ,
20
- use : require . resolve ( 'raw-loader' ) ,
21
- } ) ;
22
- }
23
- return item ;
24
- } ) ;
25
16
26
17
// Get the project version.
27
18
conf . plugins ! . push (
28
19
new webpack . DefinePlugin ( {
29
20
VERSION : JSON . stringify ( pkg . version ) ,
30
21
} )
31
22
) ;
32
-
23
+ conf . output = { ... conf . output , publicPath : './' }
33
24
return conf ;
34
25
}
35
26
Original file line number Diff line number Diff line change 13
13
"doc:dev" : " ENTRYDIR=website kkt start" ,
14
14
"build" : " npm run ts:build && npm run types:esm && npm run types:cjs && npm run css:build" ,
15
15
"types:build" : " tsbb types --sourceRoot src --target ESNEXT" ,
16
+ "watch" : " npm run ts:watch & npm run types:watch" ,
16
17
"types:watch" : " npm run types:esm -- --watch & npm run types:cjs -- --watch" ,
17
18
"types:esm" : " npm run types:build -- --outDir ../lib/esm" ,
18
19
"types:cjs" : " npm run types:build -- --outDir ../lib/cjs" ,
39
40
},
40
41
"devDependencies" : {
41
42
"@kkt/loader-less" : " 5.8.0" ,
43
+ "@kkt/loader-raw" : " 5.8.0" ,
42
44
"@types/classnames" : " 2.2.10" ,
43
45
"@types/react" : " 16.9.34" ,
44
46
"@types/react-dom" : " 16.9.6" ,
45
47
"@uiw/react-code-preview" : " 1.11.4" ,
46
48
"@uiw/react-github-corners" : " 1.1.3" ,
49
+ "@uiw/react-markdown-preview" : " 1.0.3" ,
47
50
"@uiw/reset.css" : " 1.0.3" ,
48
51
"compile-less-cli" : " 1.4.0" ,
49
52
"kkt" : " 5.8.0" ,
50
- "raw-loader" : " 4.0.1" ,
51
53
"react" : " 16.13.1" ,
52
54
"react-dom" : " 16.13.1" ,
53
- "react-markdown" : " 4.3.1" ,
54
55
"tsbb" : " 1.7.0" ,
55
56
"uiw" : " 3.10.9"
56
57
},
You can’t perform that action at this time.
0 commit comments