Skip to content

Commit

Permalink
feat: Use codemirror 6. #88
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 6, 2021
1 parent 1d28698 commit 1739514
Show file tree
Hide file tree
Showing 23 changed files with 524 additions and 1,674 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ jobs:
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
# - run: npm install @jsdevtools/npm-publish -g
# - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" --tag="next" ./package.json
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
build
lib
cjs
esm
npm-debug.log*
package-lock.json
Expand Down
29 changes: 15 additions & 14 deletions .kktrc.js → .kktrc.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import path from 'path';
import webpack from 'webpack';
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, env, options) => {
conf = rawModules(conf, env, { ...options });
export default (conf: Configuration, env: 'development' | 'production', options: LoaderConfOptions) => {
conf = rawModules(conf, env, {
...options,
test: /\.(txt|md)$/i,
esModule: true,
});
conf = scopePluginOptions(conf, env, {
...options,
allowedFiles: [
path.resolve(process.cwd(), 'src'),
path.resolve(process.cwd(), 'README.md')
]
});
conf = lessModules(conf, env, options);
// Get the project version.
conf.plugins.push(new webpack.DefinePlugin({
conf.plugins!.push(new webpack.DefinePlugin({
VERSION: JSON.stringify(pkg.version),
}));

Expand All @@ -28,16 +34,11 @@ export default (conf, env, options) => {
name: 'react-vendor',
chunks: 'all',
},
prismjs: {
test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
name: 'codemirror-vendor',
chunks: 'async',
},
prismjs: {
test: /[\\/]node_modules[\\/](code-example)[\\/]/,
name: 'code-example-vendor',
chunks: 'async',
},
// prismjs: {
// test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
// name: 'codemirror-vendor',
// chunks: 'async',
// },
},
},
};
Expand Down
Loading

0 comments on commit 1739514

Please sign in to comment.