Skip to content

update master & update loaders & update plugins #418

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 86 commits into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
f2a258a
update /content/loaders & /content/plugins
hello-lizhihua Sep 3, 2017
a5725bb
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Sep 3, 2017
248be26
update /content/loaders & /content/plugins
hello-lizhihua Sep 19, 2017
36c53b8
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Sep 19, 2017
25a3d6d
Merge branch 'master' into cn
hello-lizhihua Oct 10, 2017
14bff9f
update /content/loaders & /content/plugins
hello-lizhihua Oct 10, 2017
debfddd
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Oct 10, 2017
57fb4d4
update contributors
hello-lizhihua Oct 10, 2017
99bf48d
Merge branch 'master' into translation
hello-lizhihua Oct 10, 2017
7fcd796
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Oct 11, 2017
78e3cee
update /content/loaders & /content/plugins
hello-lizhihua Oct 15, 2017
8a1b2c9
Merge branch 'master' into translation
hello-lizhihua Oct 15, 2017
34575cd
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Oct 15, 2017
3251e8a
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Oct 15, 2017
7396c0d
Merge branch 'master' into cn
hello-lizhihua Oct 15, 2017
c0dc1be
fix LinkDropdown
hello-lizhihua Oct 15, 2017
4809e4a
Merge branch 'translation' into cn
hello-lizhihua Oct 15, 2017
178eeeb
修复 npm 命令错误导致编译不成功的问题
hello-lizhihua Oct 17, 2017
8ec33ad
update /content/loaders & /content/plugins
hello-lizhihua Oct 17, 2017
cc7b5e1
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Oct 17, 2017
93ebe40
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Oct 29, 2017
1ca293a
update /content/loaders & /content/plugins
hello-lizhihua Oct 30, 2017
a132154
Merge branch 'master' into translation
hello-lizhihua Oct 30, 2017
9fbf758
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Oct 30, 2017
a40704a
update /content/loaders & /content/plugins
hello-lizhihua Nov 1, 2017
53d47d1
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Nov 1, 2017
68c4bdd
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Nov 1, 2017
d622470
docs(plugins): fix typo in module-concatenation-plugin.md (#1683)
mattdsteele Nov 1, 2017
52eb2a4
docs(concepts): simplify the introduction (#1673)
TheDutchCoder Nov 1, 2017
6e8d65d
docs(plugins): add “scope hoisting” intro in module-concatenation-plu…
iamakulov Nov 3, 2017
66443e6
docs(api): fix some method signatures in loaders.md (#1685)
aparajita Nov 3, 2017
b13613e
update /content/loaders & /content/plugins
Nov 4, 2017
0e407de
Merge remote-tracking branch 'upstream/translation' into translation
Nov 4, 2017
d6295cc
Merge remote-tracking branch 'upstream/master'
Nov 4, 2017
955b221
docs(guides): consistent quoute use in typescript.md (#1687)
ulrikstrid Nov 5, 2017
ac739ee
docs(api/guides): document new --concatenate-modules flag (#1686)
iamakulov Nov 5, 2017
6d30cac
docs(guides): fix issues with examples in shimming.md (#1680)
svyandun Nov 5, 2017
ccac872
docs(guides): add middleware tip to the hmr guide
skipjack Nov 5, 2017
5dcd8ac
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Nov 5, 2017
0f539cb
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Nov 5, 2017
c71abf9
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Nov 5, 2017
c9cdb7e
Revert "A new --concatenate-modules flag" (#1692)
skipjack Nov 5, 2017
ebd64c9
update master
hello-lizhihua Nov 6, 2017
796d087
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Nov 6, 2017
4a2422b
Merge branch 'master' into cn
hello-lizhihua Nov 6, 2017
fe130ff
update master
hello-lizhihua Nov 6, 2017
19fc4f6
update /content/loaders & /content/plugins
hello-lizhihua Nov 7, 2017
b9d59a4
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Nov 7, 2017
38fc0d4
Merge branch 'translation' into cn
hello-lizhihua Nov 7, 2017
34dd7b4
docs(concepts): fix grammar in output.md (#1694)
reergymerej Nov 10, 2017
29899d8
docs(contribute): update writing-a-loader (#1691)
ThaNarie Nov 10, 2017
5a7cbe7
docs(plugins): add external example in SourceMapDevToolPlugin (#1676)
hkrutzer Nov 10, 2017
4760409
docs(config): update dev-server open option (#1693)
applemate Nov 11, 2017
63574ba
fix bugs
hello-lizhihua Nov 12, 2017
192c38e
update /content/loaders & /content/plugins
hello-lizhihua Nov 12, 2017
1511650
docs(api): improve formatting and grammar in loaders.md
skipjack Nov 11, 2017
ab6f188
docs(api): clarify fourth parameter of `this.callback` in loaders.md
skipjack Nov 11, 2017
e6c94a4
docs(api): populate missing link in loaders.md
skipjack Nov 12, 2017
4b80c8b
docs(plugins): correct example in html-webpack-plugin (#1698)
Jocs Nov 13, 2017
b24ea5e
docs(guides): update an example in production.md (#1696)
ogonkov Nov 13, 2017
0fb8a35
fix(markdown): fix overflowing inline code (#1701)
kamleshchandnani Nov 15, 2017
251f704
docs(concepts): update concepts wording (#1702)
TheLarkInn Nov 15, 2017
4f2f269
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Nov 18, 2017
c5142de
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Nov 18, 2017
5a59bb7
update /content/loaders & /content/plugins
hello-lizhihua Nov 18, 2017
8597638
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Nov 18, 2017
4d2e2b8
docs(config): fix dead link to webpack-dev-server example (#1704)
loilo Nov 19, 2017
549d14c
docs(concepts): use fragment links in usage instructions (#1705)
CentroDL Nov 19, 2017
9f473f5
docs(guides): add windows usage tip in getting-started (#1671)
Vanguard90 Nov 23, 2017
b8e8365
doc(guides): fix grammatical error in build-performance (#1709)
davesidious Nov 23, 2017
067cb0d
docs(guides): correct two small typos
mbsrc Nov 21, 2017
e57a11b
docs(api): remove inadvertent double verb (#1714)
MajorBreakfast Nov 23, 2017
2efe399
docs(contribute): fix grammar in writing-a-plugin (#1715)
MajorBreakfast Nov 23, 2017
05714b5
docs(config): add semicolon for consistency (#1716)
connorholyday Nov 26, 2017
93e4b4d
docs(contributing): add note about debian OS (#1721)
sukrosono Dec 2, 2017
4eefcee
docs(guides): add output example to shimming doc (#1720)
agudulin Dec 2, 2017
afe298d
docs(plugins): use `.includes` over `.indexOf` (#1719)
mattvagni Dec 2, 2017
955ff3f
docs(guides): use `npx` in getting-started (#1708)
MajorBreakfast Dec 2, 2017
efcce14
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Dec 3, 2017
0f36909
Merge remote-tracking branch 'upstream/master'
hello-lizhihua Dec 3, 2017
27991dc
update /src/content/loaders & /src/content/plugins
hello-lizhihua Dec 3, 2017
3ff5dfe
Merge remote-tracking branch 'upstream/translation' into translation
hello-lizhihua Dec 3, 2017
1e898cb
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Dec 3, 2017
46e6781
Merge branch 'translation' into cn
hello-lizhihua Dec 3, 2017
4fe9b6f
Merge remote-tracking branch 'upstream/cn' into cn
hello-lizhihua Dec 4, 2017
b5f821d
Merge branch 'master' into cn
hello-lizhihua Dec 4, 2017
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ node_modules
npm-debug.log
build
generated
support-backers.json
support-sponsors.json
support-*.json
starter-kits-data.json
.antwar
.idea
10 changes: 5 additions & 5 deletions src/components/Splash/Splash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ const Splash = () => (
<p>通过你的贡献、捐款或者赞助,webpack 将获得繁荣发展。你的捐助直接用于支持我们付出工作、持续改进,最加重要的是有助于我们提供优秀的文档和资料!</p>

<h2>平台赞助</h2>
<Support type="sponsors" rank="platinum" />
<Support rank="platinum" />

<h2>金牌赞助</h2>
<Support type="sponsors" rank="gold" />
<Support rank="gold" />

<h2>银牌赞助</h2>
<Support type="sponsors" rank="silver" />
<Support rank="silver" />

<h2>铜牌赞助</h2>
<Support type="sponsors" rank="bronze" />
<Support rank="bronze" />

<h2>赞助者</h2>
<Support type="backers" />
<Support rank="backer" />
</Container>
</div>
</div>
Expand Down
58 changes: 43 additions & 15 deletions src/components/Support/Support.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React from 'react';
import Additional from './support-additional.json';
import GoldSponsors from './support-goldsponsors.json';
import SilverSponsors from './support-silversponsors.json';
import Sponsors from './support-sponsors.json';
import Backers from './support-backers.json';
import Additional from './support-additional.js';
import './Support.scss';

const ranks = {
backer: {
maximum: 200
},
bronze: {
minimum: 200,
maximum: 2000
},
silver: {
Expand All @@ -19,17 +27,37 @@ const ranks = {
}
};

function formatMoney(number) {
let str = Math.round(number) + '';
if (str.length > 3) {
str = str.substr(0, str.length - 3) + ',' + str.substr(-3);
}
return str;
}

export default class Support extends React.Component {
render() {
let { rank, type } = this.props;
let supporters = require(`./support-${type}.json`);
let { rank } = this.props;
let supporters = [
...GoldSponsors,
...SilverSponsors,
...Sponsors,
...Backers,
];

if (type === 'sponsors') {
supporters = supporters.slice();
supporters.push(...Additional);
supporters.sort((a, b) => b.totalDonations - a.totalDonations);
// merge or add additional backers/sponsors
for(const additional of Additional) {
const existing = supporters.find(supporter => supporter.username && supporter.username === additional.username);
if (existing) {
existing.totalDonations += additional.totalDonations;
} else {
supporters.push(additional);
}
}

// resort list
supporters.sort((a, b) => b.totalDonations - a.totalDonations);

let minimum, maximum;

if (rank && ranks[rank]) {
Expand All @@ -48,14 +76,14 @@ export default class Support extends React.Component {
return (
<div className="support">
<div className="support__description">
{ type === 'sponsors' ? (
{ rank === 'backer' ? (
<p>
<b className="support__rank">{ rank } sponsors</b>
<span>are those who have pledged { minimum ? `$${minimum}` : 'up' } { maximum ? `to $${maximum}` : 'or more' } to webpack.</span>
The following <b>Backers</b> are individuals who have contributed various amounts of money in order to help support webpack. Every little bit helps, and we appreciate even the smallest contributions.
</p>
) : (
<p>
The following <b>Backers</b> are individuals who have contributed various amounts of money in order to help support webpack. Every little bit helps, and we appreciate even the smallest contributions.
<b className="support__rank">{ rank } sponsors</b>
<span>are those who have pledged { minimum ? `$${formatMoney(minimum)}` : 'up' } { maximum ? `to $${formatMoney(maximum)}` : 'or more' } to webpack.</span>
</p>
)}
</div>
Expand All @@ -64,22 +92,22 @@ export default class Support extends React.Component {
supporters.map((supporter, index) => (
<a key={ supporter.id || supporter.username || index }
className="support__item"
title={ `$${supporter.totalDonations / 100} by ${supporter.name || supporter.username}` }
title={ `$${formatMoney(supporter.totalDonations / 100)} by ${supporter.name || supporter.username}` }
target="_blank"
href={ supporter.website || `https://opencollective.com/${supporter.username}` }>
{ supporter.avatar ? <img
className={ `support__${type}-avatar-${rank || 'normal'}` }
className={ `support__${rank}-avatar` }
src={ supporter.avatar }
alt={ supporter.username ? `${supporter.username}'s avatar` : 'avatar' } /> :
supporter.name }
{ type === 'backers' ? <figure className="support__outline" /> : null }
{ rank === 'backer' ? <figure className="support__outline" /> : null }
</a>
))
}

<div className="support__bottom">
<a className="support__button" href="https://opencollective.com/webpack#support">
Become a { type.replace(/s$/, '') }
Become a { rank === 'backer' ? 'backer' : 'sponsor' }
</a>
</div>
</div>
Expand Down
31 changes: 17 additions & 14 deletions src/components/Support/Support.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@
margin: 0 2px 2px 2px;
}

&__sponsors-avatar {
&-bronze, &-normal {
height: 32px;
}
&-silver {
height: 64px;
}
&-gold {
height: 96px;
}
&-platinum {
height: 128px;
}
&__bronze-avatar {
height: 32px;
max-width: 96px;
}

&__silver-avatar {
height: 64px;
max-width: 192px;
}

&__gold-avatar {
height: 96px;
}

&__platinum-avatar {
height: 128px;
}

&__backers-avatar-normal {
&__backer-avatar {
width: 31px;
height: 31px;
border-radius: 50%;
Expand Down
Binary file added src/components/Support/assets/segment-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions src/components/Support/support-additional.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export default [
{
name: "MoonMail",
avatar: "https://static.moonmail.io/moonmail-logo.svg",
website: "https://moonmail.io/?utm_source=webpack.js.org",
totalDonations: 11000,
reason: "Paypal"
},
{
name: "Google Angular",
avatar: "https://res.cloudinary.com/opencollective/image/upload/v1485288529/angular_uxllte.png",
website: "https://angular.io/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 250000,
reason: "Paypal"
},
{
name: "Architects.io",
avatar: null,
website: "http://architects.io/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 30000,
reason: "Paypal"
},
{
username: "peerigon",
name: "Peerigon",
avatar: "https://opencollective-production.s3-us-west-1.amazonaws.com/e8a1de10-99c8-11e6-8650-f92e594d5de8.png",
website: "https://peerigon.com/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 144139,
reason: "webpack meetup 2017-07"
},
{
name: "Segment",
avatar: require("./assets/segment-logo.png"),
website: "https://segment.com/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
totalDonations: 2400000,
reason: "Sponsorship 2017-07 - 2017-09"
}
];
23 changes: 0 additions & 23 deletions src/components/Support/support-additional.json
Original file line number Diff line number Diff line change
@@ -1,23 +0,0 @@
[
{
"name": "MoonMail",
"tier": "sponsor",
"avatar": "https://static.moonmail.io/moonmail-logo.svg",
"website": "https://moonmail.io/?utm_source=webpack.js.org",
"totalDonations": 11000
},
{
"name": "Google Angular",
"tier": "sponsor",
"avatar": "https://res.cloudinary.com/opencollective/image/upload/v1485288529/angular_uxllte.png",
"website": "https://angular.io/",
"totalDonations": 250000
},
{
"name": "Architects.io",
"tier": "sponsor",
"avatar": null,
"website": "http://architects.io/",
"totalDonations": 30000
}
]
21 changes: 12 additions & 9 deletions src/content/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,17 @@ webpack --env.platform=web # 设置 env.platform == "web"

`--env` 参数具有多种语法 accepts various syntaxes:

Invocation | Resulting environment
------------------------------- | ---------------------------
`webpack --env prod` | `"prod"`
`webpack --env.prod` | `{ prod: true }`
`webpack --env.prod=1` | `{ prod: 1 }`
`webpack --env.prod=foo` | `{ prod: "foo" }`
`webpack --env.prod --env.min` | `{ prod: true, min: true }`
`webpack --env.prod --env min` | `[{ prod: true }, "min"]`
Invocation | Resulting environment
---------------------------------------- | ---------------------------
`webpack --env prod` | `"prod"`
`webpack --env.prod` | `{ prod: true }`
`webpack --env.prod=1` | `{ prod: 1 }`
`webpack --env.prod=foo` | `{ prod: "foo" }`
`webpack --env.prod --env.min` | `{ prod: true, min: true }`
`webpack --env.prod --env min` | `[{ prod: true }, "min"]`
`webpack --env.prod=foo --env.prod=bar` | `{prod: [ "foo", "bar" ]}`

T> See the [environment variables](/guides/environment-variables) guide for more information on its usage.

### 输出配置

Expand Down Expand Up @@ -292,7 +295,7 @@ webpack.js index=./src/index.js index2=./src/index2.js --output-path='./dist' --

简写 | 含义
---------|----------------------------
-d | `--debug --devtool cheap-module-source-map --output-pathinfo`
-d | `--debug --devtool cheap-module-eval-source-map --output-pathinfo`
-p | `--optimize-minimize --define process.env.NODE_ENV="production"`, see [building for production](/guides/production)


Expand Down
2 changes: 2 additions & 0 deletions src/content/api/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ T> webpack **不**会并行执行多个配置。每个配置只会在前一个
* `.run(callback)`
* `.watch(watchOptions, handler)`

W> The API only supports a single concurrent compilation at a time. When using `run`, wait for it to finish before calling `run` or `watch` again. When using `watch`, call `close` and wait for it to finish before calling `run` or `watch` again. Concurrent compilations will corrupt the output files.


## 执行(Run)

Expand Down
2 changes: 1 addition & 1 deletion src/content/api/plugins/compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ compiler.options = {...};
class LogPlugin {
apply (compiler) {
compiler.plugin('should-emit', compilation => {
console.log('should i emit?');
console.log('should I emit?');
return true;
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/configuration/configuration-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- skipjack
- tarang9211
- simon04
- peterblazejewicz
---

webpack 接受以多种编程和数据语言编写的配置文件。支持的文件扩展名列表,可以在 [node-interpret](https://github.com/js-cli/js-interpret) 包中找到。使用 [node-interpret](https://github.com/js-cli/js-interpret),webpack 可以处理许多不同类型的配置文件。
Expand All @@ -26,7 +27,6 @@ __webpack.config.ts__
```typescript
import * as webpack from 'webpack';
import * as path from 'path';
declare var __dirname;

const config: webpack.Configuration = {
entry: './foo.js',
Expand Down
2 changes: 1 addition & 1 deletion src/content/configuration/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ W> 小心!resource 是文件的_解析_路径,这意味着符号链接的资

还有一个额外的种类"行内 loader",loader 被应用在 import/require 行内。

所有 loader 通过 `后置, 行内, 普通, 前置` 排序,并按此顺序使用。
所有 loader 通过 `前置, 行内, 普通, 后置` 排序,并按此顺序使用。

所有普通 loader 可以通过在请求中加上 `!` 前缀来忽略(覆盖)。

Expand Down
Loading