Open
Description
- I confirm that this is an issue rather than a question.
Bug report
I'm trying to debug production build with the help of sourcemaps but seems like turning them on (setting devtool: 'source-map' in
configureWebpack` object) breaks it - scripts doesn't work and build behaves like a set of static HTML pages.
Steps to reproduce
- Clone https://github.com/th0r/vuepress-sourcemap-bug
- Run
npm ci && npm run build && npx http-server src/.vuepress/dist
- Open
http://127.0.0.1:8080
and ensure that build works:
- Input
a
into the search bar and ensure that suggestion popup appears - Click
Guide
link and ensure that search bar still containsa
(new page has been loaded dynamically, without full page reload)
- Run
SOURCEMAPS=true npm run build && npx http-server src/.vuepress/dist
.SOURCEMAPS=true
env variable setsdevtool
webpack option tosource-map
(see src/.vuepress/config.js). - Open
http://127.0.0.1:8080
and ensure that JS bundle is not cached (checkDisable cache
in browsers dev tools and reload the page) - Build is broken:
- Input
a
into the search bar - suggestion popup doesn't appear - Click
Guide
link - search bar becomes empty which means full page reload happened.
What is expected?
See "Steps to reproduce"
What is actually happening?
See "Steps to reproduce"
Other relevant information
- Output of
npx vuepress info
in my VuePress project:
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 12.19.1 - ~/.nvm/versions/node/v12.19.1/bin/node
Yarn: Not Found
npm: 6.14.8 - ~/.nvm/versions/node/v12.19.1/bin/npm
Browsers:
Chrome: 86.0.4240.198
Edge: Not Found
Firefox: 81.0.2
Safari: 14.0
npmPackages:
@vuepress/core: 1.7.1
@vuepress/theme-default: 1.7.1
vuepress: ^1.5.3 => 1.7.1
npmGlobalPackages:
vuepress: Not Found