Skip to content

Commit b53324d

Browse files
jjyyxxulivz
authored andcommitted
fix($core): Generated js have SyntaxError when source-map is enabled (close: #1367) (#1378)
1 parent ad0ff72 commit b53324d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/@vuepress/core/lib/build.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
4747
// find and remove empty style chunk caused by
4848
// https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85
4949
// TODO remove when it's fixed
50-
await workaroundEmptyStyleChunk()
50+
if (!clientConfig.devtool && (!clientConfig.plugins ||
51+
!clientConfig.plugins.some(p =>
52+
p instanceof webpack.SourceMapDevToolPlugin ||
53+
p instanceof webpack.EvalSourceMapDevToolPlugin
54+
))) {
55+
await workaroundEmptyStyleChunk()
56+
}
5157

5258
// create server renderer using built manifests
5359
const renderer = createBundleRenderer(serverBundle, {

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -6568,7 +6568,7 @@ markdown-it-anchor@^5.0.2:
65686568

65696569
markdown-it-chain@^1.3.0:
65706570
version "1.3.0"
6571-
resolved "http://registry.npm.taobao.org/markdown-it-chain/download/markdown-it-chain-1.3.0.tgz#ccf6fe86c10266bafb4e547380dfd7f277cc17bc"
6571+
resolved "https://registry.yarnpkg.com/markdown-it-chain/-/markdown-it-chain-1.3.0.tgz#ccf6fe86c10266bafb4e547380dfd7f277cc17bc"
65726572
dependencies:
65736573
webpack-chain "^4.9.0"
65746574

0 commit comments

Comments
 (0)