1 Star 7 Fork 0

uiw/react-markdown-preview

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.kktrc.ts 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
小弟调调 提交于 2021-02-14 09:17 . chore: Modify kkt config. #23
import path from 'path';
import webpack, {Configuration} from 'webpack';
import { LoaderConfOptions } from 'kkt';
import lessModules from '@kkt/less-modules';
import rawModules from '@kkt/raw-modules';
import scopePluginOptions from '@kkt/scope-plugin-options';
import pkg from './package.json';
export default (conf: Configuration, env: string, options: LoaderConfOptions) => {
conf = rawModules(conf, env, { ...options });
conf = lessModules(conf, env, options);
conf = scopePluginOptions(conf, env, {
...options,
allowedFiles: [
path.resolve(process.cwd(), 'README.md'),
]
});
// Get the project version.
conf.plugins!.push(new webpack.DefinePlugin({
VERSION: JSON.stringify(pkg.version),
}));
conf.optimization = {
...conf.optimization,
splitChunks: {
cacheGroups: {
reactvendor: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
chunks: 'all',
},
prismjs: {
test: /[\\/]node_modules[\\/](prismjs)[\\/]/,
name: 'prismjs-vendor',
chunks: 'async',
},
}
}
}
return conf;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/uiw/react-markdown-preview.git
git@gitee.com:uiw/react-markdown-preview.git
uiw
react-markdown-preview
react-markdown-preview
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385