Skip to content

Commit

Permalink
fix: add bundle file output config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 3, 2022
1 parent a0aa562 commit 65c1c21
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/color/.kktrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
import lessModules from '@kkt/less-modules';

export default (conf: WebpackConfiguration, env: 'production' | 'development', options: LoaderConfOptions) => {
conf = lessModules(conf, env, options);
if (options.bundle) {
conf.output!.library = '@uiw/react-color';
conf.externals = {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
};
}
return conf;
};

0 comments on commit 65c1c21

Please sign in to comment.