Skip to content

Merge the next branch #1993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dafbbb2
adding docs for new `output.devtoolNamespace` option and [namespace] …
MagicDuck Oct 17, 2017
f3c515c
adding extra lines as indicated
MagicDuck Oct 20, 2017
8ccb3da
docs(config): update `hashFunction` docs based on v4 (#1761)
EugeneHlushko Jan 16, 2018
7fa4fe0
docs(api): reformat index page at 80 characters / line
skipjack Dec 16, 2017
388aa68
docs(api): reformat node api docs and add more details on the compiler
skipjack Dec 16, 2017
4896c00
docs(api): reformat/rewrite the lead-in plugin docs and remove `tapab…
skipjack Dec 17, 2017
d5c0a24
docs(api): remove `module-factories.md` and `template.md`
skipjack Dec 17, 2017
38e33c2
docs(api): reformat line length in plugins.md
skipjack Dec 17, 2017
33caf72
docs(api): rewrite, rename, and resort the `compiler.md` page
skipjack Dec 18, 2017
ede8e02
docs(api): rewrite, rename, and resort the `compilation.md` page
skipjack Dec 18, 2017
e0f7a62
docs(api): fix sorting and start to reformat the last two plugin pages
skipjack Dec 18, 2017
ebe7331
docs(api): begin rewrite of the resolver page
skipjack Dec 27, 2017
b066b44
docs(config): fix header nesting in resolve.md
skipjack Dec 27, 2017
93efa5d
docs(api): rename resolvers page for clarity and finish rewrite
skipjack Dec 27, 2017
1555e7c
docs(api): make minor corrections to plugin docs
skipjack Dec 31, 2017
7941097
docs(api): rewrite the parser documentation
skipjack Dec 31, 2017
acf7b77
docs(api): update some of the compiler hook descriptions
skipjack Feb 7, 2018
7b89b9f
docs(plugins): add `ProfilingPlugin` documentation (#1830)
EugeneHlushko Feb 23, 2018
4354b9a
docs(config): document `info-verbosity` option in watch.md (#1817)
EugeneHlushko Feb 23, 2018
b1d2779
Merge branch 'master' into next
sokra Feb 26, 2018
6194853
update tree shaking guide for webpack 4
quantizor Feb 28, 2018
6de8690
docs(Guides): Update Getting Started to use webpack 4
TheDutchCoder Mar 1, 2018
7d1f662
docs(concepts): Update plugins.md (#1871)
arjendeblok Mar 1, 2018
44eb6c9
Merge branch 'master' into next
montogeek Mar 1, 2018
45db042
docs(Stats): add `buitlAt` to the example configuration (#1878)
osenvosem Mar 3, 2018
a44fa0a
docs(guides): add doctype to Get Started (#1874)
TheDutchCoder Mar 5, 2018
38faec2
docs(API): add missing config options to cli.md (#1880)
joshunger Mar 6, 2018
0c96dd5
docs(Concepts): update concepts page for v4 (#1883)
EugeneHlushko Mar 6, 2018
0e545a1
update related links to be relevant for webpack 4
quantizor Mar 15, 2018
9ad350d
add note about side effects and non-JS files
quantizor Mar 15, 2018
2f19976
add some more advanced usage notes
quantizor Mar 15, 2018
c1318e1
Merge pull request #1865 from probablyup/update-se-docs
jeremenichelli Mar 15, 2018
051a566
docs(concepts) Clarification about NODE_ENV and mode (#1885)
montogeek Mar 15, 2018
e1029fc
chore(site): Delete package-lock.json (#1917)
dhruvdutt Mar 16, 2018
8b13724
docs(guides): Correct a path error in getting started example (#1899)
bingtimren Mar 17, 2018
bec9d42
chore: Resolve conflicts on next branch (#1923)
dhruvdutt Mar 19, 2018
3197738
Merge branch 'master' into next
TheLarkInn Mar 19, 2018
40d89f9
docs(api) Fix markdown lint errors
montogeek Mar 19, 2018
74cb0e7
docs(api) Fix Plugins wording
montogeek Mar 19, 2018
6fa39c0
content(homepage) Mention 0CJS capability (#1884)
EugeneHlushko Mar 27, 2018
2b737d0
docs(guides) Fix error with filename + npm package. (#1886)
Zicrael Mar 27, 2018
a60c9c9
docs(guides): Added info for v4 and webpack-cli (#1888)
Mar 27, 2018
d6812de
docs(configuration) Update snippets to comply with webpack v4+ (#1905)
EugeneHlushko Mar 27, 2018
8861696
Merge branch 'master' into next
montogeek Apr 6, 2018
cc8223a
fix(docs) Remove git conflict
montogeek Apr 6, 2018
30a7741
Merge branch 'master' into next
montogeek Apr 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ starter-kits-data.json
.antwar
.vscode
.idea
.DS_Store
.DS_Store
2 changes: 1 addition & 1 deletion src/content/api/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ different hook classes and how they work.

## Next Steps

See the [compiler hooks](https://webpack.js.org/api/compiler-hooks/) section for a detailed listing of all the available
See the [compiler hooks](/api/compiler-hooks/) section for a detailed listing of all the available
`compiler` hooks and the parameters they make available.
3 changes: 2 additions & 1 deletion src/content/concepts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ T> The most important part to take away from this document is that there are man

The following examples below describe how webpack's configuration object can be both expressive and configurable because _it is code_:

## The Simplest Configuration
## Simple Configuration

**webpack.config.js**

```javascript
var path = require('path');

module.exports = {
mode: 'development',
entry: './foo.js',
output: {
path: path.resolve(__dirname, 'dist'),
Expand Down
4 changes: 3 additions & 1 deletion src/content/configuration/configuration-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import path from 'path';
import webpack from 'webpack';

const config: webpack.Configuration = {
mode: 'production',
entry: './foo.js',
output: {
path: path.resolve(__dirname, 'dist'),
Expand Down Expand Up @@ -103,6 +104,7 @@ webpack = require('webpack')
path = require('path')

config =
mode: 'production'
entry: './path/to/my/entry/file.js'
output:
path: path.resolve(__dirname, 'dist')
Expand Down Expand Up @@ -152,7 +154,7 @@ const CustomPlugin = config => ({
});

export default (
<webpack target="web" watch>
<webpack target="web" watch mode="production">
<entry path="src/index.js" />
<resolve>
<alias {...{
Expand Down
3 changes: 3 additions & 0 deletions src/content/configuration/configuration-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ One option is to export a function from your webpack config instead of exporting
-module.exports = {
+module.exports = function(env, argv) {
+ return {
+ mode: env.production ? 'production' : 'development',
+ devtool: env.production ? 'source-maps' : 'eval',
plugins: [
new webpack.optimize.UglifyJsPlugin({
Expand Down Expand Up @@ -64,11 +65,13 @@ module.exports = [{
libraryTarget: 'amd'
},
entry: './app.js',
mode: 'production',
}, {
output: {
filename: './dist-commonjs.js',
libraryTarget: 'commonjs'
},
entry: './app.js',
mode: 'production',
}]
```
7 changes: 7 additions & 0 deletions src/content/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ __webpack.config.js__
const path = require('path');

module.exports = {
<details><summary>[mode](/concepts/mode): "production", // "production" | "development" | "none"</summary>
[mode](/concepts/mode): "production", // enable many optimizations for production builds
[mode](/concepts/mode): "development", // enabled useful tools for development
[mode](/concepts/mode): "none", // no defaults
</details>
// Chosen mode tells webpack to use its built-in optimizations accordingly.

<details><summary>[entry](/configuration/entry-context#entry): "./app/entry", // string | object | array</summary>
[entry](/configuration/entry-context#entry): ["./app/entry1", "./app/entry2"],
[entry](/configuration/entry-context#entry): {
Expand Down
2 changes: 1 addition & 1 deletion src/content/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Version: webpack 4.0.1
Time: 3003ms
Built at: 2018-2-26 22:42:11
Asset Size Chunks Chunk Names
bundle.js 69.6 KiB 0 [emitted] main
main.js 69.6 KiB 0 [emitted] main
Entrypoint main = main.js
[1] (webpack)/buildin/module.js 519 bytes {0} [built]
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
Expand Down
6 changes: 6 additions & 0 deletions src/content/guides/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ npm install --save-dev webpack
npm install --save-dev webpack@<version>
```

If you're using webpack 4 or later, you'll also need to install the CLI.

``` bash
npm install --save-dev webpack-cli
```

Installing locally is what we recommend for most projects. This makes it easier to upgrade projects individually when breaking changes are introduced. Typically webpack is run via one or more [npm scripts](https://docs.npmjs.com/misc/scripts) which will look for a webpack installation in your local `node_modules` directory:

```json
Expand Down
13 changes: 8 additions & 5 deletions src/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: webpack

<div class="splash__wrap">
<div class="splash__left">
__app.js__
__src/index.js__

```js
import bar from './bar';
Expand All @@ -15,7 +15,7 @@ bar();
```
</div>
<div class="splash__right">
__bar.js__
__src/bar.js__

```js
export default function bar() {
Expand All @@ -30,12 +30,15 @@ export default function bar() {

<div class="splash__wrap">
<div class="splash__left">
__webpack.config.js__
__[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)__ or provide custom __webpack.config.js__

```js
const path = require('path');

module.exports = {
entry: './app.js',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
}
};
Expand All @@ -52,7 +55,7 @@ __page.html__
</head>
<body>
...
<script src="bundle.js"></script>
<script src="dist/bundle.js"></script>
</body>
</html>
```
Expand Down
Loading