Skip to content

Commit ec5aac4

Browse files
Merge branch 'master' into cn (#433)
* update /content/loaders & /content/plugins * update /content/loaders & /content/plugins * update /content/loaders & /content/plugins * update contributors * update /content/loaders & /content/plugins * fix LinkDropdown * 修复 npm 命令错误导致编译不成功的问题 * update /content/loaders & /content/plugins * update /content/loaders & /content/plugins * update /content/loaders & /content/plugins * docs(plugins): fix typo in module-concatenation-plugin.md (#1683) * docs(concepts): simplify the introduction (#1673) Make the `index` page more beginner friendly with less technical lingo and complex details. Resolves #1416 * docs(plugins): add “scope hoisting” intro in module-concatenation-plugin (#1684) This adds a link between “concatenation behavior” and “scope hoisting”. Without this, a new person might be confused what exactly “scope hoisting” is (because it appears without any visible connection to the previous content). * docs(api): fix some method signatures in loaders.md (#1685) In actual fact the parameters passed to `emitWarning` / `emitError` must be an instance of Error. * update /content/loaders & /content/plugins * docs(guides): consistent quoute use in typescript.md (#1687) * docs(api/guides): document new --concatenate-modules flag (#1686) Document the new `--concatenate-modules` flag in both the CLI documentation and production guide. Add section on the `ModuleConcatenationPlugin` in the production guide (as we include this plugin under `-p`, it also makes sense to mention it in this guide. * docs(guides): fix issues with examples in shimming.md (#1680) Rename plugin identifier and require webpack when it is used in the configuration examples. * docs(guides): add middleware tip to the hmr guide Resolves #1682 * Revert "A new --concatenate-modules flag" (#1692) * update master * update /content/loaders & /content/plugins * docs(concepts): fix grammar in output.md (#1694) * docs(contribute): update writing-a-loader (#1691) Use normal function instead of arrow function to fix scope in loader example. * docs(plugins): add external example in SourceMapDevToolPlugin (#1676) Demonstrate how one might use the plugin to host source maps externally. * docs(config): update dev-server open option (#1693) State the ability to open in specific browser. * fix bugs * update /content/loaders & /content/plugins * docs(api): improve formatting and grammar in loaders.md * docs(api): clarify fourth parameter of `this.callback` in loaders.md Add some lead in descriptions to the `Examples` section and clarify that meta data can be passed along via the fourth parameter to `this.callback` and accepted as the third parameter to a loader function. Resolves #1607 * docs(api): populate missing link in loaders.md * docs(plugins): correct example in html-webpack-plugin (#1698) * docs(guides): update an example in production.md (#1696) Switch to shortened form when using the `DefinePlugin` to define the `process.env.NODE_ENV` value. This avoids a bug which is mentioned in the plugin's documentation: https://webpack.js.org/plugins/define-plugin/#feature-flags * fix(markdown): fix overflowing inline code (#1701) Change the css to fix the text inside code tag which was overflowing the parent div. * docs(concepts): update concepts wording (#1702) Add "static" to "module bundler". Some feedback here was given to me on twitter to make sure we are clear with what these terms mean. * update /content/loaders & /content/plugins * docs(config): fix dead link to webpack-dev-server example (#1704) * docs(concepts): use fragment links in usage instructions (#1705) This is just a quality of life adjustment that updates the list of ways to use loaders with fragment links to the relevant section in the docs. In their current state, the section feels like a dead end, abruptly cutting off with three bullet points and no examples. While one can read on and figure it out, there is a break in focus that is quite distracting. * docs(guides): add windows usage tip in getting-started (#1671) * doc(guides): fix grammatical error in build-performance (#1709) Change "less" to "fewer". * docs(guides): correct two small typos * docs(api): remove inadvertent double verb (#1714) * docs(contribute): fix grammar in writing-a-plugin (#1715) * docs(config): add semicolon for consistency (#1716) The final code block was missing a semicolon from the end of the first line; added it in to match the other require statements. * docs(contributing): add note about debian OS (#1721) Related issue: #1718 * docs(guides): add output example to shimming doc (#1720) * docs(plugins): use `.includes` over `.indexOf` (#1719) Really minor but I think `.includes` is more readable to the unfamiliar with javascript. * docs(guides): use `npx` in getting-started (#1708) Keep the mention the webpack binary's path but use the `npx` utility now that it ships with Node. Fix some punctuation and grammar. Clarify why npm scripts are still useful even over `npx`. * update /src/content/loaders & /src/content/plugins * docs(contribute): link compiler docs in writing-a-plugin (#1700) While authoring plugins the list of hooks is essential knowledge, so a link to hooks documentation page should be accessible in the top of writing a plugin guide. * docs(guides): fix `source-map` discrepancy in production.md (#1711) The `webpack.prod.js` code example in the "Specify the Evironment" section shows `cheap-module-source-map` for the `devtool` field which is not recommended for production. This section should show `source-map` to be consistent with the webpack.prod.js in the previous "Source Mapping" section. * docs(guides): rename 'runtime' to 'manifest' in caching.md (#1713) Preserve CommonsChunkPlugin boilerplate naming consistency as referenced in the CommonsChunkPlugin documentation (see below) when extracting webpack runtime and manifest boilerplate. https://webpack.js.org/plugins/commons-chunk-plugin#manifest-file * docs(guides): update output to webpack 3.9.1 (#1724) * docs(plugins): update the source-map-devtool-plugin (#1707) Clean up formatting a bit and add undocumented options from webpack/webpack#5986. Update the external source maps example to demonstrate path stripping. * docs(contribute): correct an example in the writers-guide (#1727) In a section which states the properties must be sorted alphabetically, sort the examples alphabetically. * docs(config): improve formatting and add note about library entry points in output.md * docs(guides): mention complex entry point configuration in author-libraries Note that `entry` arrays are not recommended, provide a way to properly expose stylesheets, and add a link to an `entry` object example. * docs(config): improve formatting and clarify the string usage in externals Resolves #1726 * docs(config): fix minor proselint error in externals * docs(api): clarify the `pitch` method and how it can be used in loaders.md Resolves #449 Resolves webpack#116 Refactored and enhanced the existing section using much of @sokra's explanation from: webpack/webpack#360 * docs(contribute): fix `import` statement in writing-a-loader.md (#1732) `validateOptions` is exported as a default module. * docs(config): update devtool production recommendations * docs(api): remove obsolete cli flag (#1733) The `--save` option has been removed from webpack's CLI. See the following pull request for reference: webpack/webpack#3896 * docs(concepts): add warning about incompatible `import` statements Resolves #1736 * docs(config): fix typescript setup in configuration-languages (#1734) Resolves #1735 * docs: use full `npm install` over `npm i` (#1740) Most of the guides use the full command, so it's best to stay consistent. * docs(guides): fix diff display for webpack.config.js entry object Resolves #1743 * docs: fix typos * docs: add tbroadley to contributor lists * docs(contribute): correct schema example in `writing-a-loader.md` (#1753) * docs(guides): add pwa guide (#1737) Add `progressive-web-application.md` guide which documents how to use the `workbox-webpack-plugin` to build an offline app. More on PWAs in webpack can be added here by future contributors. Resolves #1145 * docs(guides): highlight css splitting in production Resolves #1741 * docs(plugins): use `.includes` over `.indexOf` Consistent usage of `.includes` * docs(config): omit invalid `detailed` option in stats.md (#1757) * fix(mobile): correctly sort pages in mobile sidebar (#1759) * chore(vote): port voting app, update deps, and simplify config (#1717) Port the voting app to a it's own repository and expose that section of the site more prominently (in the header). This commit also... - Simplifies the webpack config slightly and allows external styles. - Updates issue template to highlight content from other repositories. - Updates some outdated dependencies. * docs(readme): reformat at 80 characters and include browserstack link By including this, _BrowserStack_ will allow us to do free testing of the site on their platform. * refactor(notification): simplify notification message and bump the version * fix(splash): fix visualization artifacts (#1762) Rebuild and clean up visualization in Sketch. Include via an inline SVG rather than an `<img>` tag. Add a `TODO` in regards to an even cleaner setup post build refactoring. Resolves #1752 * chore: pick up vote fix and update yarn lock file * chore(vote): pick up another vote patch * Update index.md (#423) * update: git merge -> git rebase * Update index.md * Update README.md * Update .travis.yml * docs: fix formatting and grammar (#1765) Fix typos, improve grammar, and change `&nbsp;` to a normal space character. * docs(concepts): change loader order from chonological to reverse (#1767) When one starts to learn about loaders it's very confusing. [This](https://webpack.js.org/contribute/writing-a-loader/#complex-usage) explains the behaviour much better. * update UPDATE.md
1 parent 9201103 commit ec5aac4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1495
-1666
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
- [ ] Check the current issues to ensure you aren't creating a duplicate.
22
- [ ] Consider making small typo fixes and such directly as pull requests.
3+
- [ ] For the voting application, go to https://github.com/webpack-contrib/voting-app.
4+
- [ ] For loader/plugin docs, consider opening an issue in the corresponding repository.
35
- [ ] No existing issue? Go ahead and open a new one.
46
- __Remove these instructions from your PR as they are for your eyes only.__

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,48 +44,62 @@ npm start
4444

4545
# webpack.js.org
4646

47-
[![build status](https://secure.travis-ci.org/webpack/webpack.js.org.svg)](http://travis-ci.org/webpack/webpack.js.org)
48-
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
47+
[![Build Status][13]][10]
48+
[![Standard Version][12]][11]
4949

5050
Guides, documentation, and all things webpack.
5151

5252

5353
## Content Progress
5454

55-
Now that we've covered much of the backlog of _missing documentation_, we are starting
56-
to heavily review each section of the site's content to sort and structure it appropriately.
57-
The following issues should provide a pretty good idea of where things are, and where
58-
they are going:
55+
Now that we've covered much of the backlog of _missing documentation_, we are
56+
starting to heavily review each section of the site's content to sort and
57+
structure it appropriately. The following issues should provide a pretty good
58+
idea of where things are, and where they are going:
5959

6060
- [Guides - Review and Simplify][1]
61-
- [Concepts - Review, Organize, Define Clear Goals][2]
61+
- [Concepts - Review and Organize][2]
62+
- [API - v4 Rewrite][8]
6263

63-
We haven't created issues for the other sections yet, but they will be coming soon. For
64-
dev-related work please see [General - Current Longterm Plan][3], which will soon be
65-
replaced by a more dev-specific issue.
64+
We haven't created issues for the other sections yet, but they will be coming
65+
soon. For dev-related work please see [General - Updates & Fixes][3].
6666

6767

6868
## Translation
6969

70-
If you hope to localize this documentation please jump to the [translate branch][4].
70+
To help translate this documentation please jump to the [translate branch][4].
7171

7272

7373
## Contributing
7474

75-
Read through the [writer's guide][7] if you're interested in editing the content on this
76-
site. See the [contributors page][5] to learn how to set up and start working on the site
77-
locally.
75+
Read through the [writer's guide][7] if you're interested in editing the
76+
content on this site. See the [contributors page][5] to learn how to set up and
77+
start working on the site locally.
7878

7979

8080
## License
8181

8282
The content is available under the [Creative Commons BY 4.0][6] license.
8383

8484

85+
## Special Thanks
86+
87+
_BrowserStack_ has graciously allowed us to do cross-browser and cross-os
88+
testing of the site at no cost...
89+
90+
[![BrowserStackLogo](./browserstack-logo.png)][9]
91+
92+
8593
[1]: https://github.com/webpack/webpack.js.org/issues/1258
8694
[2]: https://github.com/webpack/webpack.js.org/issues/1386
87-
[3]: https://github.com/webpack/webpack.js.org/issues/1380
95+
[3]: https://github.com/webpack/webpack.js.org/issues/1525
8896
[4]: https://github.com/webpack/webpack.js.org/tree/translation
8997
[5]: https://github.com/webpack/webpack.js.org/blob/master/.github/CONTRIBUTING.md
9098
[6]: https://creativecommons.org/licenses/by/4.0/
9199
[7]: https://webpack.js.org/writers-guide
100+
[8]: https://github.com/webpack/webpack.js.org/pull/1754
101+
[9]: http://browserstack.com/
102+
[10]: http://travis-ci.org/webpack/webpack.js.org
103+
[11]: https://github.com/conventional-changelog/standard-version
104+
[12]: https://img.shields.io/badge/release-standard%20version-brightgreen.svg
105+
[13]: https://secure.travis-ci.org/webpack/webpack.js.org.svg

UPDATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## 更新记录
2+
3+
### 2018.01.13
4+
* 合并记录:合并 master 分支
5+
* 合并记录:https://github.com/webpack-china/webpack.js.org/pull/433

browserstack-logo.png

35.3 KB
Loading

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@
4747
"antwar-helpers": "^0.19.0",
4848
"antwar-interactive": "^0.19.0",
4949
"async": "^2.5.0",
50-
"autoprefixer": "^7.1.3",
50+
"autoprefixer": "^7.2.3",
5151
"babel-core": "^6.26.0",
5252
"babel-eslint": "^7.2.3",
5353
"babel-loader": "^7.1.2",
5454
"babel-plugin-transform-class-properties": "^6.24.1",
5555
"babel-plugin-transform-object-rest-spread": "^6.26.0",
5656
"babel-preset-env": "^1.6.0",
5757
"babel-preset-react": "^6.24.1",
58-
"copy-webpack-plugin": "^4.0.1",
58+
"copy-webpack-plugin": "^4.3.0",
5959
"css-loader": "^0.28.5",
6060
"duplexer": "^0.1.1",
6161
"eslint": "4.5.0",
6262
"eslint-loader": "^1.9.0",
63-
"eslint-plugin-markdown": "^1.0.0-beta.6",
63+
"eslint-plugin-markdown": "^1.0.0-beta.7",
6464
"extract-text-webpack-plugin": "^3.0.0",
6565
"file-loader": "^0.11.2",
6666
"fontgen-loader": "^0.2.1",
@@ -69,22 +69,22 @@
6969
"github": "^10.0.0",
7070
"html-webpack-plugin": "^2.30.1",
7171
"http-server": "^0.10.0",
72-
"hyperlink": "^3.0.0",
72+
"hyperlink": "^3.0.1",
7373
"loader-utils": "^1.1.0",
7474
"lodash": "^4.17.4",
7575
"markdown-loader": "^2.0.1",
7676
"markdownlint": "^0.6.0",
7777
"markdownlint-cli": "^0.3.1",
78-
"marked": "^0.3.6",
78+
"marked": "^0.3.7",
7979
"mkdirp": "^0.5.1",
8080
"modularscale-sass": "^3.0.3",
81-
"moment": "^2.18.1",
81+
"moment": "^2.20.1",
8282
"ncp": "^2.0.0",
8383
"node-sass": "^4.5.3",
8484
"npm-run-all": "^4.1.1",
8585
"postcss-loader": "^2.0.6",
8686
"prism-languages": "^0.3.3",
87-
"prismjs": "^1.6.0",
87+
"prismjs": "^1.9.0",
8888
"raw-loader": "^0.5.1",
8989
"request": "^2.81.0",
9090
"sass-loader": "^6.0.6",
@@ -94,21 +94,22 @@
9494
"tap-parser": "^6.0.1",
9595
"through2": "^2.0.3",
9696
"url-loader": "^0.5.9",
97-
"webpack": "^3.5.5",
98-
"webpack-dev-server": "^2.7.1",
97+
"webpack": "^3.10.0",
98+
"webpack-dev-server": "^2.9.7",
9999
"webpack-merge": "^4.1.0",
100100
"yaml-frontmatter-loader": "^0.1.0"
101101
},
102102
"dependencies": {
103-
"ajv": "^5.2.2",
104-
"preact": "^8.2.5",
103+
"ajv": "^5.5.2",
104+
"preact": "^8.2.7",
105105
"preact-compat": "3.17.0",
106106
"prop-types": "^15.5.10",
107107
"react": "^15.6.1",
108108
"react-dom": "^15.6.1",
109109
"react-router": "^4.2.0",
110110
"react-router-dom": "^4.2.2",
111111
"tool-list": "^0.11.0",
112+
"webpack.vote": "^0.1.2",
112113
"whatwg-fetch": "^2.0.3"
113114
}
114115
}

src/assets/homepage-modules.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/Navigation/Links.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"title": "参与贡献",
1616
"url": "contribute"
1717
},
18+
{
19+
"title": "投票",
20+
"url": "vote"
21+
},
1822
{
1923
"title": "博客",
2024
"url": "//medium.com/webpack"

src/components/NotificationBar/NotificationBar.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import Container from '../Container/Container';
33
import testLocalStorage from '../../utilities/test-local-storage';
44

5-
const version = '1';
5+
const version = '2';
66
const localStorageIsEnabled = testLocalStorage() !== false;
77

88
export default class NotificationBar extends React.Component {
@@ -13,17 +13,16 @@ export default class NotificationBar extends React.Component {
1313
<div className={ `notification-bar ${dismissedMod}` }>
1414
<Container className="notification-bar__inner">
1515
<p>
16-
赞助 webpack,同时获取官方衣服!访问 <a href="https://webpack.threadless.com">webpack 官方商店!</a>&nbsp; 查看所有收益请转到 webpack 的 <a href="https://opencollective.com/webpack">Open Collective 页面!</a>
17-
</p>
18-
<p>
19-
<a href="http://www.unixstickers.com/tag/webpack">Unixstickers!</a> 上购买全新的 webpack 贴纸
20-
{localStorageIsEnabled ?
21-
<button
22-
className="notification-bar__close icon-cross"
23-
onClick={ this._close.bind(this) } /> :
24-
null
25-
}
16+
赞助 webpack,同时从<a href="https://webpack.threadless.com">官方商店</a>购买衣服{' '}
17+
或者在<a href="http://www.unixstickers.com/tag/webpack">这里</a>购买贴纸!所有收益将转到我们的{' '}
18+
<a href="https://opencollective.com/webpack">open collective</a>
2619
</p>
20+
{ localStorageIsEnabled ?
21+
<button
22+
className="notification-bar__close icon-cross"
23+
onClick={ this._close.bind(this) } /> :
24+
null
25+
}
2726
</Container>
2827
</div>
2928
);

src/components/NotificationBar/NotificationBar.scss

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
color: getColor(white);
66
background: getColor(emperor);
77

8-
p:not(:last-child) {
9-
padding-bottom: 1em;
10-
}
11-
128
p {
139
font-size: 14px;
1410
}
@@ -36,15 +32,15 @@
3632
}
3733

3834
.notification-bar__close {
39-
color: getColor(white);
40-
font-size: 16px;
41-
padding: 0;
42-
background: none;
43-
border: none;
4435
position: absolute;
36+
font-size: 16px;
4537
top: 10px;
4638
right: 1em;
39+
padding: 0;
40+
border: none;
4741
cursor: pointer;
42+
color: getColor(white);
43+
background: none;
4844
transition: color 250ms;
4945

5046
&:hover {

src/components/Site/Site.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ const Site = ({
4545
title: section.path.title,
4646
url: section.url,
4747
pages: section.pages.map(page => ({
48+
file: page.file,
4849
title: page.file.title,
4950
url: page.url
50-
}))
51+
})).sort(({ file: { attributes: a }}, { file: { attributes: b }}) => {
52+
let group1 = a.group.toLowerCase();
53+
let group2 = b.group.toLowerCase();
54+
55+
if (group1 < group2) return -1;
56+
if (group1 > group2) return 1;
57+
return a.sort - b.sort;
58+
})
5159
}))
5260
} />
5361

src/components/SplashViz/SplashViz.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
import Cube from '../Cube/Cube';
44
import TextRotator from '../TextRotater/TextRotater';
5-
import Modules from '../../assets/homepage-modules.svg';
5+
import homeSVG from './SplashVizSVG';
66

77
export default class SplashViz extends React.Component {
88

@@ -18,9 +18,7 @@ export default class SplashViz extends React.Component {
1818
<span> styles </span>
1919
</TextRotator>
2020
</h1>
21-
<div className="splash-viz__modules">
22-
<img src={ Modules } alt="dependency bundling graphic"/>
23-
</div>
21+
<div className="splash-viz__modules" dangerouslySetInnerHTML={{__html: homeSVG.body}}></div>
2422
<Cube className="splash-viz__cube" depth={ 120 } repeatDelay={ 5000 } continuous/>
2523
</section>
2624
);

src/components/SplashViz/SplashViz.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@
2727
position: absolute;
2828
left: 0;
2929
right: 0;
30-
top: 0;
30+
top: 50%; // vertical center
3131
bottom: 0;
3232
width: 75vw;
3333
min-width: 550px;
3434
max-width: map-get($screens, large);
35-
margin: auto;
35+
margin: 0 auto;
36+
transform: translateY(-50%); // vertical center
3637
display: none;
3738

3839
@include break {
39-
display: block;
40+
display: table; // Get height of its child svg
4041
}
4142

4243
img {

0 commit comments

Comments
 (0)