Skip to content

Commit 878cfaf

Browse files
committed
chore(deps): Update dependency kkt to v7.1.5
1 parent c94c7c0 commit 878cfaf

File tree

4 files changed

+79
-68
lines changed

4 files changed

+79
-68
lines changed

.kktrc.ts

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,78 @@
11
import path from 'path';
2-
import webpack, { Configuration } from 'webpack';
3-
import { LoaderConfOptions } from 'kkt';
2+
import webpack from 'webpack';
3+
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
44
import lessModules from '@kkt/less-modules';
55
import rawModules from '@kkt/raw-modules';
66
import scopePluginOptions from '@kkt/scope-plugin-options';
77
import pkg from './package.json';
88

9-
export default (conf: Configuration, env: 'production' | 'development', options: LoaderConfOptions) => {
9+
export default (conf: WebpackConfiguration, env: 'production' | 'development', options: LoaderConfOptions) => {
1010
conf = lessModules(conf, env, options);
11-
conf = rawModules(conf, env, { ...options });
12-
conf = scopePluginOptions(conf, env, {
13-
...options,
14-
allowedFiles: [
15-
path.resolve(process.cwd(), 'README.md')
16-
]
17-
});
18-
// Get the project version.
19-
conf.plugins!.push(new webpack.DefinePlugin({
20-
VERSION: JSON.stringify(pkg.version),
21-
}));
22-
if (env === 'production') {
23-
conf.module!.exprContextCritical = false;
24-
conf.output = { ...conf.output, publicPath: './' };
25-
conf.optimization = {
26-
...conf.optimization,
27-
splitChunks: {
28-
cacheGroups: {
29-
reactvendor: {
30-
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
31-
name: 'react-vendor',
32-
chunks: 'all',
33-
},
34-
babelstandalone: {
35-
test: /[\\/]node_modules[\\/](@babel[\\/]standalone)[\\/]/,
36-
name: 'babel-standalone-vendor',
37-
chunks: 'all',
38-
},
39-
prismjs: {
40-
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
41-
name: 'refractor-vendor',
42-
chunks: 'all',
43-
},
44-
codemirror: {
45-
test: /[\\/]node_modules[\\/](@codemirror)[\\/]/,
46-
name: 'codemirror-vendor',
47-
chunks: 'all',
48-
},
49-
uiw: {
50-
test: /[\\/]node_modules[\\/](@uiw)[\\/]/,
51-
name: 'uiw-vendor',
52-
chunks: 'all',
53-
},
54-
parse5: {
55-
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
56-
name: 'parse5-vendor',
57-
chunks: 'all',
58-
},
59-
},
11+
if (options.bundle) {
12+
conf.output!.library = '@uiw/react-split';
13+
conf.externals = {
14+
react: {
15+
root: 'React',
16+
commonjs2: 'react',
17+
commonjs: 'react',
18+
amd: 'react',
6019
},
6120
};
21+
} else {
22+
conf = rawModules(conf, env, { ...options });
23+
conf = scopePluginOptions(conf, env, {
24+
...options,
25+
allowedFiles: [
26+
path.resolve(process.cwd(), 'README.md')
27+
]
28+
});
29+
// Get the project version.
30+
conf.plugins!.push(new webpack.DefinePlugin({
31+
VERSION: JSON.stringify(pkg.version),
32+
}));
33+
34+
if (env === 'production') {
35+
conf.module!.exprContextCritical = false;
36+
conf.output = { ...conf.output, publicPath: './' };
37+
conf.optimization = {
38+
...conf.optimization,
39+
splitChunks: {
40+
cacheGroups: {
41+
reactvendor: {
42+
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
43+
name: 'react-vendor',
44+
chunks: 'all',
45+
},
46+
babelstandalone: {
47+
test: /[\\/]node_modules[\\/](@babel[\\/]standalone)[\\/]/,
48+
name: 'babel-standalone-vendor',
49+
chunks: 'all',
50+
},
51+
prismjs: {
52+
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
53+
name: 'refractor-vendor',
54+
chunks: 'all',
55+
},
56+
codemirror: {
57+
test: /[\\/]node_modules[\\/](@codemirror)[\\/]/,
58+
name: 'codemirror-vendor',
59+
chunks: 'all',
60+
},
61+
uiw: {
62+
test: /[\\/]node_modules[\\/](@uiw)[\\/]/,
63+
name: 'uiw-vendor',
64+
chunks: 'all',
65+
},
66+
parse5: {
67+
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
68+
name: 'parse5-vendor',
69+
chunks: 'all',
70+
},
71+
},
72+
},
73+
};
74+
}
6275
}
6376

6477
return conf;
6578
}
66-

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
"homepage": "https://uiwjs.github.io/react-split",
88
"scripts": {
99
"prepare": "npm run build",
10-
"released": "npm run build && npm run doc",
10+
"released": "npm run build && npm run bundle && npm run bundle:min && npm run doc",
1111
"doc": "kkt build --app-src ./website",
1212
"start": "kkt start --app-src ./website",
1313
"css:watch": "compile-less -d src -o esm --watch",
1414
"css:build": "compile-less -d src -o esm",
1515
"css:build:dist": "compile-less -d src --combine dist.css --rm-global",
16+
"bundle": "ncc build src/index.tsx --target web --filename split",
17+
"bundle:min": "ncc build src/index.tsx --target web --filename split --minify",
1618
"watch": "tsbb watch & npm run css:watch",
1719
"build": "tsbb build && npm run css:build && npm run css:build:dist",
20+
"test": "tsbb test",
21+
"coverage": "tsbb test --coverage --bail",
1822
"type-check": "tsc --noEmit"
1923
},
2024
"repository": {
@@ -25,6 +29,7 @@
2529
"license": "MIT",
2630
"files": [
2731
"dist.css",
32+
"dist",
2833
"src",
2934
"esm",
3035
"cjs"
@@ -34,21 +39,22 @@
3439
"react-dom": ">=16.8.0"
3540
},
3641
"devDependencies": {
37-
"@kkt/less-modules": "7.0.5",
38-
"@kkt/raw-modules": "7.0.5",
39-
"@kkt/scope-plugin-options": "7.0.5",
40-
"@types/react": "17.0.38",
42+
"@kkt/less-modules": "~7.1.1",
43+
"@kkt/ncc": "~1.0.8",
44+
"@kkt/raw-modules": "~7.1.1",
45+
"@kkt/scope-plugin-options": "~7.1.1",
46+
"@types/react": "17.0.39",
4147
"@types/react-dom": "17.0.11",
4248
"@uiw/react-code-preview": "4.0.5",
4349
"@uiw/react-github-corners": "1.5.3",
4450
"@uiw/react-markdown-preview": "3.4.7",
4551
"@uiw/reset.css": "1.0.5",
4652
"compile-less-cli": "1.8.11",
47-
"kkt": "7.0.5",
53+
"kkt": "~7.1.5",
4854
"react": "17.0.2",
4955
"react-dom": "17.0.2",
50-
"tsbb": "3.5.4",
51-
"uiw": "4.9.7"
56+
"tsbb": "~3.7.0",
57+
"uiw": "~4.12.1"
5258
},
5359
"eslintConfig": {
5460
"extends": [

src/react-app-env.d.ts

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

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"resolveJsonModule": true,
1818
"isolatedModules": true,
1919
"declaration": true,
20-
"baseUrl": "./website",
2120
"jsx": "react-jsx",
2221
"noFallthroughCasesInSwitch": true,
2322
"noUnusedLocals": true,

0 commit comments

Comments
 (0)