Skip to content

Commit

Permalink
fix($core): Generated js have SyntaxError when source-map is enabled (c…
Browse files Browse the repository at this point in the history
…lose: #1367) (#1378)
  • Loading branch information
jjyyxx authored and ulivz committed Mar 2, 2019
1 parent ad0ff72 commit b53324d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/@vuepress/core/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
// find and remove empty style chunk caused by
// https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85
// TODO remove when it's fixed
await workaroundEmptyStyleChunk()
if (!clientConfig.devtool && (!clientConfig.plugins ||
!clientConfig.plugins.some(p =>
p instanceof webpack.SourceMapDevToolPlugin ||
p instanceof webpack.EvalSourceMapDevToolPlugin
))) {
await workaroundEmptyStyleChunk()
}

// create server renderer using built manifests
const renderer = createBundleRenderer(serverBundle, {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6568,7 +6568,7 @@ markdown-it-anchor@^5.0.2:

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

Expand Down

0 comments on commit b53324d

Please sign in to comment.