Skip to content

Commit 1739514

Browse files
committed
feat: Use codemirror 6. #88
1 parent 1d28698 commit 1739514

23 files changed

+524
-1674
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ jobs:
6565
${{ steps.changelog.outputs.compareurl }}
6666
${{ steps.changelog.outputs.changelog }}
6767
68-
- run: npm install @jsdevtools/npm-publish -g
69-
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
68+
# - run: npm install @jsdevtools/npm-publish -g
69+
# - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" --tag="next" ./package.json

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
node_modules
22
build
3-
lib
3+
cjs
44
esm
55
npm-debug.log*
66
package-lock.json

.kktrc.js renamed to .kktrc.ts

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import path from 'path';
2-
import webpack from 'webpack';
2+
import webpack, { Configuration } from 'webpack';
3+
import { LoaderConfOptions } from 'kkt';
34
import lessModules from '@kkt/less-modules';
45
import rawModules from '@kkt/raw-modules';
56
import scopePluginOptions from '@kkt/scope-plugin-options';
67
import pkg from './package.json';
78

8-
export default (conf, env, options) => {
9-
conf = rawModules(conf, env, { ...options });
9+
export default (conf: Configuration, env: 'development' | 'production', options: LoaderConfOptions) => {
10+
conf = rawModules(conf, env, {
11+
...options,
12+
test: /\.(txt|md)$/i,
13+
esModule: true,
14+
});
1015
conf = scopePluginOptions(conf, env, {
1116
...options,
1217
allowedFiles: [
18+
path.resolve(process.cwd(), 'src'),
1319
path.resolve(process.cwd(), 'README.md')
1420
]
1521
});
1622
conf = lessModules(conf, env, options);
1723
// Get the project version.
18-
conf.plugins.push(new webpack.DefinePlugin({
24+
conf.plugins!.push(new webpack.DefinePlugin({
1925
VERSION: JSON.stringify(pkg.version),
2026
}));
2127

@@ -28,16 +34,11 @@ export default (conf, env, options) => {
2834
name: 'react-vendor',
2935
chunks: 'all',
3036
},
31-
prismjs: {
32-
test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
33-
name: 'codemirror-vendor',
34-
chunks: 'async',
35-
},
36-
prismjs: {
37-
test: /[\\/]node_modules[\\/](code-example)[\\/]/,
38-
name: 'code-example-vendor',
39-
chunks: 'async',
40-
},
37+
// prismjs: {
38+
// test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
39+
// name: 'codemirror-vendor',
40+
// chunks: 'async',
41+
// },
4142
},
4243
},
4344
};

0 commit comments

Comments
 (0)