Skip to content

Commit ce3e350

Browse files
sakshi27montogeek
authored andcommitted
docs(guides) Changing the output file to main.js (#1951)
`npx webpack` creates an output file as`main.js` instead of 'bundle.js`. We need to point to `main.js` in the `index.html'
1 parent dd890c6 commit ce3e350

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/guides/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ __dist/index.html__
167167
</head>
168168
<body>
169169
- <script src="./src/index.js"></script>
170-
+ <script src="bundle.js"></script>
170+
+ <script src="main.js"></script>
171171
</body>
172172
</html>
173173
```
174174

175175
In this setup, `index.js` explicitly requires `lodash` to be present, and binds it as `_` (no global scope pollution). By stating what dependencies a module needs, webpack can use this information to build a dependency graph. It then uses the graph to generate an optimized bundle where scripts will be executed in the correct order.
176176

177-
With that said, let's run `npx webpack` with our script as the [entry point](/concepts/entry-points) and `bundle.js` as the [output](/concepts/output). The `npx` command, which ships with Node 8.2 or higher, runs the webpack binary (`./node_modules/.bin/webpack`) of the webpack package we installed in the beginning:
177+
With that said, let's run `npx webpack` with our script as the [entry point](/concepts/entry-points) and `main.js` as the [output](/concepts/output). The `npx` command, which ships with Node 8.2 or higher, runs the webpack binary (`./node_modules/.bin/webpack`) of the webpack package we installed in the beginning:
178178

179179
``` bash
180180
npx webpack
@@ -185,7 +185,7 @@ Time: 3003ms
185185
Built at: 2018-2-26 22:42:11
186186
Asset Size Chunks Chunk Names
187187
bundle.js 69.6 KiB 0 [emitted] main
188-
Entrypoint main = bundle.js
188+
Entrypoint main = main.js
189189
[1] (webpack)/buildin/module.js 519 bytes {0} [built]
190190
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
191191
[3] ./src/index.js 256 bytes {0} [built]

0 commit comments

Comments
 (0)