11 Star 100 Fork 20

uiw / react-markdown-editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.kktrc.ts 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
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: 'production' | 'development', options: LoaderConfOptions) => {
conf = lessModules(conf, env, options);
conf = rawModules(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),
}),
);
if (env === 'production') {
conf.output = { ...conf.output, publicPath: './' };
conf.optimization = {
...conf.optimization,
splitChunks: {
cacheGroups: {
reactvendor: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
chunks: 'all',
},
prismjs: {
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
name: 'refractor-vendor',
chunks: 'all',
},
uiw: {
test: /[\\/]node_modules[\\/](@uiw)[\\/]/,
name: 'uiw-vendor',
chunks: 'all',
},
codemirror: {
test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
name: 'codemirror-vendor',
chunks: 'all',
},
parse5: {
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
name: 'parse5-vendor',
chunks: 'all',
},
},
},
};
}
return conf;
};
TypeScript
1
https://gitee.com/uiw/react-markdown-editor.git
git@gitee.com:uiw/react-markdown-editor.git
uiw
react-markdown-editor
react-markdown-editor
master

搜索帮助