Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
ff547752
Commit
ff547752
authored
Feb 15, 2017
by
Tim Neutkens
Committed by
Naoyuki Kanezawa
Feb 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server * Add suggested changes
parent
38d236e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
README.md
examples/with-webpack-bundle-analyzer/README.md
+3
-1
next.config.js
examples/with-webpack-bundle-analyzer/next.config.js
+4
-4
package.json
examples/with-webpack-bundle-analyzer/package.json
+3
-2
No files found.
examples/with-webpack-bundle-analyzer/README.md
View file @
ff547752
...
@@ -7,7 +7,7 @@ Download the example [or clone the repo](https://github.com/zeit/next.js):
...
@@ -7,7 +7,7 @@ Download the example [or clone the repo](https://github.com/zeit/next.js):
```
bash
```
bash
curl https://codeload.github.com/zeit/next.js/tar.gz/master |
tar
-xz
--strip
=
2 next.js-master/examples/with-webpack-bundle-analyzer
curl https://codeload.github.com/zeit/next.js/tar.gz/master |
tar
-xz
--strip
=
2 next.js-master/examples/with-webpack-bundle-analyzer
cd
hello-world
cd
with-webpack-bundle-analyzer
```
```
Install it and run:
Install it and run:
...
@@ -26,3 +26,5 @@ now
...
@@ -26,3 +26,5 @@ now
## The idea behind the example
## The idea behind the example
This example shows how to analyze the output bundles using
[
webpack-bundle-analyzer
](
https://github.com/th0r/webpack-bundle-analyzer#as-plugin
)
This example shows how to analyze the output bundles using
[
webpack-bundle-analyzer
](
https://github.com/th0r/webpack-bundle-analyzer#as-plugin
)
To view the stats use
`npm run bundle:view`
examples/with-webpack-bundle-analyzer/next.config.js
View file @
ff547752
...
@@ -4,11 +4,11 @@ module.exports = {
...
@@ -4,11 +4,11 @@ module.exports = {
// Perform customizations to config
// Perform customizations to config
config
.
plugins
.
push
(
config
.
plugins
.
push
(
new
BundleAnalyzerPlugin
({
new
BundleAnalyzerPlugin
({
analyzerMode
:
'disabled'
,
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
analyzerMode
:
'server'
,
generateStatsFile
:
true
,
analyzerHost
:
'127.0.0.1'
,
// Will be available at `.next/stats.json`
analyzerPort
:
8888
,
statsFilename
:
'stats.json'
openAnalyzer
:
false
})
})
)
)
// Important: return the modified config
// Important: return the modified config
...
...
examples/with-webpack-bundle-analyzer/package.json
View file @
ff547752
{
{
"name"
:
"
hello-world
"
,
"name"
:
"
with-webpack-bundle-analyzer
"
,
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"scripts"
:
{
"scripts"
:
{
"dev"
:
"next"
,
"dev"
:
"next"
,
"build"
:
"next build"
,
"build"
:
"next build"
,
"start"
:
"next start"
"start"
:
"next start"
,
"bundle:view"
:
"webpack-bundle-analyzer .next/stats.json"
},
},
"dependencies"
:
{
"dependencies"
:
{
"next"
:
"beta"
,
"next"
:
"beta"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment