Skip to content

Commit 300f11c

Browse files
committed
feat: add optional chaining plugin and update webpack config for markmap and yaml support
Signed-off-by: Yukai Huang <[email protected]>
1 parent 29837c2 commit 300f11c

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
['@babel/plugin-transform-runtime', {
1313
corejs: 3
1414
}],
15-
'@babel/plugin-transform-nullish-coalescing-operator'
15+
'@babel/plugin-transform-nullish-coalescing-operator',
16+
'@babel/plugin-transform-optional-chaining'
1617
]
1718
}

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"devDependencies": {
110110
"@babel/core": "^7.24.0",
111111
"@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
112+
"@babel/plugin-transform-optional-chaining": "^7.24.0",
112113
"@babel/plugin-transform-runtime": "^7.24.0",
113114
"@babel/preset-env": "^7.24.0",
114115
"@babel/runtime": "^7.24.0",

webpack.common.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,18 @@ module.exports = {
463463
test: /\.mjs$/,
464464
type: 'javascript/auto',
465465
include: /node_modules/
466+
}, {
467+
test: /node_modules\/markmap-[^/]+\/.*\.mjs$/,
468+
use: [{ loader: 'babel-loader' }]
469+
}, {
470+
test: /node_modules\/markmap-[^/]+\/.*\.js$/,
471+
use: [{ loader: 'babel-loader' }]
472+
}, {
473+
test: /node_modules\/yaml\/browser\/dist\/.*\.js$/,
474+
use: [{ loader: 'babel-loader' }]
475+
}, {
476+
test: /node_modules\/@vscode\/markdown-it-katex\/.*\.js$/,
477+
use: [{ loader: 'babel-loader' }]
466478
}, {
467479
test: /\.js$/,
468480
use: [{ loader: 'babel-loader' }],

0 commit comments

Comments
 (0)