Skip to content

Commit ced1afd

Browse files
authored
refactor: 移除 @kkt/raw-modules 依赖包 (#134)
1 parent 2da7d55 commit ced1afd

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

.kktrc.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import path from 'path';
22
import webpack from 'webpack';
33
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
44
import lessModules from '@kkt/less-modules';
5-
import rawModules from '@kkt/raw-modules';
65
import scopePluginOptions from '@kkt/scope-plugin-options';
76
import pkg from './package.json';
8-
import { mdCodeModulesLoader } from "markdown-react-code-preview-loader";
7+
import { mdCodeModulesLoader } from 'markdown-react-code-preview-loader';
98

10-
export default (conf: WebpackConfiguration, env: 'production' | 'development', options: LoaderConfOptions) => {
9+
export default (
10+
conf: WebpackConfiguration,
11+
env: 'production' | 'development',
12+
options: LoaderConfOptions
13+
) => {
1114
conf = lessModules(conf, env, options);
1215
if (options.bundle) {
1316
conf.output!.library = '@uiw/react-split';
@@ -20,19 +23,18 @@ export default (conf: WebpackConfiguration, env: 'production' | 'development', o
2023
},
2124
};
2225
} else {
23-
conf = rawModules(conf, env, { ...options });
2426
conf = scopePluginOptions(conf, env, {
2527
...options,
26-
allowedFiles: [
27-
path.resolve(process.cwd(), 'README.md')
28-
]
28+
allowedFiles: [path.resolve(process.cwd(), 'README.md')],
2929
});
3030
// Get the project version.
31-
conf.plugins!.push(new webpack.DefinePlugin({
32-
VERSION: JSON.stringify(pkg.version),
33-
}));
31+
conf.plugins!.push(
32+
new webpack.DefinePlugin({
33+
VERSION: JSON.stringify(pkg.version),
34+
})
35+
);
3436
conf = mdCodeModulesLoader(conf);
35-
37+
3638
if (env === 'production') {
3739
conf.module!.exprContextCritical = false;
3840
conf.output = { ...conf.output, publicPath: './' };
@@ -77,4 +79,4 @@ export default (conf: WebpackConfiguration, env: 'production' | 'development', o
7779
}
7880

7981
return conf;
80-
}
82+
};

website/Page.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)