Skip to content

next export adds all hot-update files #5554

@iamstarkov

Description

@iamstarkov

Bug report

all in a title; details are below

Describe the bug

if you develop next.js site for awhile and then run next export in the out folder you will get a lot of hot-update files in an out folder, which are required only for development and redundant for prod

That makes now deployment pretty slow, I unexpectedly got 248 files to deploy for my next-js based version of a blog.

To Reproduce

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/basic-export
cd basic-export/
atom . # or vim .
yarn
yarn dev
# open http://localhost:3000
# change ./pages/index.js few times
# make sure to get few hot updates
# stop
yarn build
yarn export
tree out/ | grep hot
tree out/ | grep hot | wc -l # 16
full log

~/projects/oss
☯ curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/basic-export
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1766k 0 1766k 0 0 849k 0 --:--:-- 0:00:02 --:--:-- 849k

~/projects/oss
☯ cd basic-export/

~/projects/oss/basic-export
☯ atom .

~/projects/oss/basic-export
☯ yarn
yarn install v1.9.4
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Saved lockfile.
✨ Done in 15.50s.

~/projects/oss/basic-export
☯ yarn dev
yarn run v1.9.4
$ next
✔ success server compiled in 163ms
✔ success client compiled in 838ms

DONE Compiled successfully in 1658ms 16:06:03

Ready on http://localhost:3000

WAIT Compiling... 16:06:03

✔ success client compiled in 64ms

DONE Compiled successfully in 122ms 16:06:03

Building page: /

WAIT Compiling... 16:06:46

✔ success server compiled in 1s 190ms
✔ success client compiled in 1s 344ms

DONE Compiled successfully in 1377ms 16:06:48

WAIT Compiling... 16:07:27

✔ success server compiled in 236ms
✔ success client compiled in 224ms

DONE Compiled successfully in 304ms 16:07:27

WAIT Compiling... 16:07:31

✔ success client compiled in 164ms

DONE Compiled successfully in 192ms 16:07:32

✔ success server compiled in 227ms

WAIT Compiling... 16:07:37

✔ success client compiled in 124ms

DONE Compiled successfully in 154ms 16:07:37

✔ success server compiled in 198ms

WAIT Compiling... 16:07:38

✔ success client compiled in 200ms

DONE Compiled successfully in 225ms 16:07:39

✔ success server compiled in 263ms

WAIT Compiling... 16:07:40

✔ success client compiled in 195ms

DONE Compiled successfully in 220ms 16:07:40

✔ success server compiled in 265ms
^C
got signal SIGINT, exiting

~/projects/oss/basic-export
☯ yarn build
yarn run v1.9.4
$ next build
[16:08:18] Compiling client
[16:08:18] Compiling server
[16:08:19] Compiled server in 969ms
[16:08:23] Compiled client in 5s
✨ Done in 7.03s.

~/projects/oss/basic-export
☯ yarn export
yarn run v1.9.4
$ next export

using build directory: /Users/vlasta/projects/oss/basic-export/.next
copying "static build" directory
No "exportPathMap" found in "next.config.js". Generating map from "./pages"
exporting path: /about
exporting path: /about2
exporting path: /day
exporting path: /index
exporting path: /404
exporting path: /

Export successful
✨ Done in 0.64s.

~/projects/oss/basic-export
☯ tree out/ | grep hot
│ ├── 23406fc088aa2cd5d5cc.hot-update.json
│ ├── 63ab2713fe0a0c0ca18a.hot-update.json
│ ├── 8a557812ce01101491df.hot-update.json
│ ├── 9fba8f1c8050faa909b4.hot-update.json
│ ├── a06dadb8d20686abb97f.hot-update.json
│ ├── b2b8fb449294bf75a044.hot-update.json
│ ├── index.js.23406fc088aa2cd5d5cc.hot-update.js
│ ├── index.js.23406fc088aa2cd5d5cc.hot-update.js.map
│ ├── index.js.63ab2713fe0a0c0ca18a.hot-update.js
│ ├── index.js.63ab2713fe0a0c0ca18a.hot-update.js.map
│ ├── index.js.8a557812ce01101491df.hot-update.js
│ ├── index.js.8a557812ce01101491df.hot-update.js.map
│ ├── index.js.9fba8f1c8050faa909b4.hot-update.js
│ ├── index.js.9fba8f1c8050faa909b4.hot-update.js.map
│ ├── index.js.b2b8fb449294bf75a044.hot-update.js
│ └── index.js.b2b8fb449294bf75a044.hot-update.js.map

~/projects/oss/basic-export
☯ tree out/ | grep hot | wc -l
16

Expected behavior

out folder should not have dev-only files, like hot-update files

Screenshots

screenshot 2018-10-30 at 4 21 36 pm

System information

  • OS: macOS 10.14 (18A391)
  • Version of Next.js: 7.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasy to fix issues, good for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions