Skip to content

Commit e637c88

Browse files
Jinjiangkazupon
authored andcommitted
[en] Webpack -> webpack (#1054)
* [en] Webpack -> webpack * [docs] Webpack -> webpack in other languages
1 parent cda4973 commit e637c88

Some content is hidden

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

67 files changed

+254
-254
lines changed

docs/en/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22

33
### What is `vue-loader`?
44

5-
`vue-loader` is a loader for Webpack that can transform Vue components written in the following format into a plain JavaScript module:
5+
`vue-loader` is a loader for webpack that can transform Vue components written in the following format into a plain JavaScript module:
66

77
![screenshot](http://blog.evanyou.me/images/vue-component.png)
88

99
There are many cool features provided by `vue-loader`:
1010

1111
- ES2015 enabled by default;
12-
- Allows using other Webpack loaders for each part of a Vue component, for example SASS for `<style>` and Jade for `<template>`;
12+
- Allows using other webpack loaders for each part of a Vue component, for example SASS for `<style>` and Jade for `<template>`;
1313
- Allows custom sections in a .vue file that can have custom loader chains applied to them
14-
- Treat static assets referenced in `<style>` and `<template>` as module dependencies and handle them with Webpack loaders;
14+
- Treat static assets referenced in `<style>` and `<template>` as module dependencies and handle them with webpack loaders;
1515
- Can simulate scoped CSS for each component;
1616
- Supports component hot-reloading during development.
1717

18-
In a nutshell, the combination of Webpack and `vue-loader` gives you a modern, flexible and extremely powerful front-end workflow for authoring Vue.js applications.
18+
In a nutshell, the combination of webpack and `vue-loader` gives you a modern, flexible and extremely powerful front-end workflow for authoring Vue.js applications.
1919

20-
### What is Webpack?
20+
### What is webpack?
2121

22-
If you are already familiar with Webpack, feel free to skip the following explanation. But for those of you who are new to Webpack, here's a quick intro:
22+
If you are already familiar with webpack, feel free to skip the following explanation. But for those of you who are new to webpack, here's a quick intro:
2323

24-
[Webpack](https://webpack.github.io/) is a module bundler. It takes a bunch of files, treating each as a module, figuring out the dependencies between them, and bundle them into static assets that are ready for deployment.
24+
[webpack](https://webpack.github.io/) is a module bundler. It takes a bunch of files, treating each as a module, figuring out the dependencies between them, and bundle them into static assets that are ready for deployment.
2525

2626
![webpack](https://webpack.github.io/assets/what-is-webpack.png)
2727

28-
For a basic example, imagine we have a bunch of CommonJS modules. They cannot run directly inside the browser, so we need to "bundle" them into a single file that can be included via a `<script>` tag. Webpack can follow the dependencies of the `require()` calls and do that for us.
28+
For a basic example, imagine we have a bunch of CommonJS modules. They cannot run directly inside the browser, so we need to "bundle" them into a single file that can be included via a `<script>` tag. webpack can follow the dependencies of the `require()` calls and do that for us.
2929

30-
But Webpack can do more than that. With "loaders", we can teach Webpack to transform all types of files in any way we want before outputting the final bundle. Some examples include:
30+
But webpack can do more than that. With "loaders", we can teach webpack to transform all types of files in any way we want before outputting the final bundle. Some examples include:
3131

3232
- Transpile ES2015, CoffeeScript or TypeScript modules into plain ES5 CommonJS modules;
3333
- Optionally you can pipe the source code through a linter before doing the compilation;
3434
- Transpile Jade templates into plain HTML and inline it as a JavaScript string;
3535
- Transpile SASS files into plain CSS, then convert it into a JavaScript snippet that insert the resulting CSS as a `<style>` tag;
3636
- Process an image file referenced in HTML or CSS, moved it to the desired destination based on the path configurations, and naming it using its md5 hash.
3737

38-
Webpack is so powerful that when you understand how it works, it can dramatically improve your front-end workflow. Its primary drawback is its verbose and complex configuration; but with this guide you should be able to find solutions for most common issues when using Webpack with Vue.js and `vue-loader`.
38+
webpack is so powerful that when you understand how it works, it can dramatically improve your front-end workflow. Its primary drawback is its verbose and complex configuration; but with this guide you should be able to find solutions for most common issues when using webpack with Vue.js and `vue-loader`.

docs/en/configurations/advanced.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To do that, specify the `loaders` option for `vue-loader`:
1212

1313
> Note that `preLoaders` and `postLoaders` are only supported in 10.3.0+
1414
15-
### Webpack 2.x
15+
### webpack 2.x
1616

1717
``` js
1818
module.exports = {
@@ -49,7 +49,7 @@ module.exports = {
4949
postLoaders: {
5050
html: 'babel-loader'
5151
},
52-
52+
5353
// `excludedPreLoaders` should be regex
5454
excludedPreLoaders: /(eslint-loader)/
5555
}
@@ -59,7 +59,7 @@ module.exports = {
5959
}
6060
```
6161

62-
### Webpack 1.x
62+
### webpack 1.x
6363

6464
``` js
6565
// webpack.config.js

docs/en/configurations/asset-url.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ will be compiled into:
1414
createElement('img', { attrs: { src: require('../image.png') }})
1515
```
1616

17-
Because `.png` is not a JavaScript file, you will need to configure Webpack to use [file-loader](https://github.com/webpack/file-loader) or [url-loader](https://github.com/webpack/url-loader) to handle them. The project scaffolded with `vue-cli` has also configured this for you.
17+
Because `.png` is not a JavaScript file, you will need to configure webpack to use [file-loader](https://github.com/webpack/file-loader) or [url-loader](https://github.com/webpack/url-loader) to handle them. The project scaffolded with `vue-cli` has also configured this for you.
1818

1919
The benefits of all this are:
2020

21-
1. `file-loader` allows you to designate where to copy and place the asset file, and how to name it using version hashes for better caching. Moreover, this also means **you can just place images next to your `*.vue` files and use relative paths based on the folder structure instead of worrying about deployment URLs**. With proper config, Webpack will auto-rewrite the file paths into correct URLs in the bundled output.
21+
1. `file-loader` allows you to designate where to copy and place the asset file, and how to name it using version hashes for better caching. Moreover, this also means **you can just place images next to your `*.vue` files and use relative paths based on the folder structure instead of worrying about deployment URLs**. With proper config, webpack will auto-rewrite the file paths into correct URLs in the bundled output.
2222

2323
2. `url-loader` allows you to conditionally inline a file as base-64 data URL if they are smaller than a given threshold. This can reduce the amount of HTTP requests for trivial files. If the file is larger than the threshold, it automatically falls back to `file-loader`.

docs/en/configurations/custom-blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ comp-a h2 {
4141
#### webpack.config.js
4242

4343
``` js
44-
// Webpack 2.x
44+
// webpack 2.x
4545
var ExtractTextPlugin = require("extract-text-webpack-plugin")
4646

4747
module.exports = {

docs/en/configurations/extract-css.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Note this only extracts `*.vue` files though - CSS imported in JavaScript still
3939

4040
Example config to extract all the processed CSS in all Vue components into a single CSS file:
4141

42-
### Webpack 2.x
42+
### webpack 2.x
4343

4444

4545
``` js
@@ -70,7 +70,7 @@ module.exports = {
7070
}
7171
```
7272

73-
### Webpack 1.x
73+
### webpack 1.x
7474

7575
``` bash
7676
npm install extract-text-webpack-plugin --save-dev

docs/en/configurations/pre-processors.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using Pre-Processors
22

3-
In Webpack, all pre-processors need to be applied with a corresponding loader. `vue-loader` allows you to use other Webpack loaders to process a part of a Vue component. It will automatically infer the proper loaders to use from the `lang` attribute of a language block.
3+
In webpack, all pre-processors need to be applied with a corresponding loader. `vue-loader` allows you to use other webpack loaders to process a part of a Vue component. It will automatically infer the proper loaders to use from the `lang` attribute of a language block.
44

55
### CSS
66

@@ -20,7 +20,7 @@ Under the hood, the text content inside the `<style>` tag will be first compiled
2020

2121
#### sass-loader caveat
2222

23-
Contrary to what its name indicates, [*sass*-loader](https://github.com/jtangelder/sass-loader) parses *SCSS* syntax by default. If you actually want to use the indented *SASS* syntax, you have to configure vue-loader's options for sass-loader accordingly.
23+
Contrary to what its name indicates, [*sass*-loader](https://github.com/jtangelder/sass-loader) parses *SCSS* syntax by default. If you actually want to use the indented *SASS* syntax, you have to configure vue-loader's options for sass-loader accordingly.
2424

2525
```javascript
2626
{
@@ -69,7 +69,7 @@ scss: generateLoaders('sass').concat(
6969
),
7070
```
7171

72-
It is recommended to only include variables, mixins, etc. in this file, to prevent duplicated css in your final, compiled files.
72+
It is recommended to only include variables, mixins, etc. in this file, to prevent duplicated css in your final, compiled files.
7373

7474
### JavaScript
7575

@@ -87,7 +87,7 @@ npm install coffee-loader --save-dev
8787

8888
### Templates
8989

90-
Processing templates is a little different, because most Webpack template loaders such as `pug-loader` return a template function instead of a compiled HTML string. Instead of using `pug-loader`, we can just install the original `pug`:
90+
Processing templates is a little different, because most webpack template loaders such as `pug-loader` return a template function instead of a compiled HTML string. Instead of using `pug-loader`, we can just install the original `pug`:
9191

9292
``` bash
9393
npm install pug --save-dev
@@ -104,12 +104,12 @@ div
104104
105105
### Inline Loader Requests
106106

107-
You can use [Webpack loader requests](https://webpack.github.io/docs/loaders.html#introduction) in the `lang` attribute:
107+
You can use [webpack loader requests](https://webpack.github.io/docs/loaders.html#introduction) in the `lang` attribute:
108108

109109
``` html
110110
<style lang="sass?outputStyle=expanded">
111111
/* use sass here with expanded output */
112112
</style>
113113
```
114114

115-
However, note this makes your Vue component Webpack-specific and not compatible with Browserify and [vueify](https://github.com/vuejs/vueify). **If you intend to ship your Vue component as a reusable 3rd-party component, avoid using this syntax.**
115+
However, note this makes your Vue component webpack-specific and not compatible with Browserify and [vueify](https://github.com/vuejs/vueify). **If you intend to ship your Vue component as a reusable 3rd-party component, avoid using this syntax.**

docs/en/features/es2015.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ You can also customize the features supported in templates using the [`buble` op
5858

5959
### Transpiling Normal `.js` Files
6060

61-
Since `vue-loader` only processes `*.vue` files, you'd need to tell Webpack to process normal `*.js` files with `babel-loader` or `buble-loader` in the Webpack config file. The project scaffolded with `vue-cli` already does it for you.
61+
Since `vue-loader` only processes `*.vue` files, you'd need to tell webpack to process normal `*.js` files with `babel-loader` or `buble-loader` in the webpack config file. The project scaffolded with `vue-cli` already does it for you.
6262

6363
### Configuring Babel with `.babelrc`
6464

docs/en/features/hot-reload.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Advanced users may want to check out [vue-hot-reload-api](https://github.com/vue
2424

2525
Hot Reload is always enabled except following situations:
2626

27-
* Webpack `target` is `node` (SSR)
28-
* Webpack minifies the code
27+
* webpack `target` is `node` (SSR)
28+
* webpack minifies the code
2929
* `process.env.NODE_ENV === 'production'`
30-
30+
3131
You may use `hotReload: false` option to disable the Hot Reload explicitly:
3232

3333
``` js
@@ -42,4 +42,4 @@ module: {
4242
}
4343
]
4444
}
45-
```
45+
```

docs/en/features/postcss.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Using a config file allows you to share the same config between your normal CSS
1616

1717
Alternatively, you can specify postcss config specifically for `*.vue` files using the `postcss` option for `vue-loader`.
1818

19-
Example usage in Webpack 1.x:
19+
Example usage in webpack 1.x:
2020

2121
``` js
2222
// webpack.config.js
@@ -29,7 +29,7 @@ module.exports = {
2929
}
3030
```
3131

32-
For Webpack 2.x:
32+
For webpack 2.x:
3333

3434
``` js
3535
// webpack.config.js

docs/en/options.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Options Reference
22

3-
## Usage Difference Between Webpack 1 & 2
3+
## Usage Difference Between webpack 1 & 2
44

5-
For Webpack 2: pass the options directly to the loader rule.
5+
For webpack 2: pass the options directly to the loader rule.
66

77
``` js
88
module.exports = {
@@ -21,7 +21,7 @@ module.exports = {
2121
}
2222
```
2323

24-
For Webpack 1.x: add a root `vue` block in your Webpack config.
24+
For webpack 1.x: add a root `vue` block in your webpack config.
2525

2626
``` js
2727
module.exports = {
@@ -36,7 +36,7 @@ module.exports = {
3636

3737
- type: `{ [lang: string]: string }`
3838

39-
An object specifying Webpack loaders to overwrite the default loaders used for language blocks inside `*.vue` files. The key corresponds to the `lang` attribute for language blocks, if specified. The default `lang` for each type is:
39+
An object specifying webpack loaders to overwrite the default loaders used for language blocks inside `*.vue` files. The key corresponds to the `lang` attribute for language blocks, if specified. The default `lang` for each type is:
4040

4141
- `<template>`: `html`
4242
- `<script>`: `js`
@@ -45,7 +45,7 @@ module.exports = {
4545
For example, to use `babel-loader` and `eslint-loader` to process all `<script>` blocks:
4646

4747
``` js
48-
// Webpack 2.x config
48+
// webpack 2.x config
4949
module: {
5050
rules: [
5151
{
@@ -144,7 +144,7 @@ module.exports = {
144144

145145
Whether to enable source maps for CSS. Disabling this can avoid some relative path related bugs in `css-loader` and make the build a bit faster.
146146

147-
Note this is automatically set to `false` if the `devtool` option is not present in the main Webpack config.
147+
Note this is automatically set to `false` if the `devtool` option is not present in the main webpack config.
148148

149149
### esModule
150150

@@ -183,7 +183,7 @@ module.exports = {
183183
- type: `{ [tag: string]: string | Array<string> }`
184184
- default: `{ img: 'src', image: 'xlink:href' }`
185185

186-
During template compilation, the compiler can transform certain attributes, such as `src` URLs, into `require` calls, so that the target asset can be handled by Webpack. The default config transforms the `src` attribute on `<img>` tags and `xlink:href` attribute on `<image>` tags of SVG.
186+
During template compilation, the compiler can transform certain attributes, such as `src` URLs, into `require` calls, so that the target asset can be handled by webpack. The default config transforms the `src` attribute on `<img>` tags and `xlink:href` attribute on `<image>` tags of SVG.
187187

188188
### buble
189189

@@ -319,5 +319,5 @@ Whether generate source maps with cache busting by appending a hash query to the
319319
- default: `true` in development mode, `false` in production mode or when the webpack config has `target: 'node'`.
320320
- allowed value: `false` (`true` will not force Hot Reload neither in production mode nor when `target: 'node'`)
321321

322-
Whether to use Webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) to apply changes in the browser **without reloading the page**.
323-
Use this option (value `false`) to disable the Hot Reload feature in development mode.
322+
Whether to use webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) to apply changes in the browser **without reloading the page**.
323+
Use this option (value `false`) to disable the Hot Reload feature in development mode.

docs/en/start/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ More details can be found in [Using Pre-Processors](../configurations/pre-proces
5656

5757
- Each `*.vue` file can contain at most one `<script>` block at a time.
5858

59-
- The script is executed in a CommonJS like environment (just like a normal `.js` module bundled via Webpack), which means you can `require()` other dependencies. And with ES2015 support, you can also use the `import` and `export` syntax.
59+
- The script is executed in a CommonJS like environment (just like a normal `.js` module bundled via webpack), which means you can `require()` other dependencies. And with ES2015 support, you can also use the `import` and `export` syntax.
6060

6161
- The script must export a Vue.js component options object. Exporting an extended constructor created by `Vue.extend()` is also supported, but a plain object is preferred.
6262

@@ -68,7 +68,7 @@ More details can be found in [Using Pre-Processors](../configurations/pre-proces
6868

6969
- A `<style>` tag can have `scoped` or `module` attributes (see [Scoped CSS](../features/scoped-css.md) and [CSS Modules](../features/css-modules.md)) to help encapsulate the styles to the current component. Multiple `<style>` tags with different encapsulation modes can be mixed in the same component.
7070

71-
- By default, contents will be extracted and dynamically inserted into the document's `<head>` as an actual `<style>` tag using `style-loader`. It's also possible to [configure Webpack so that all styles in all components are extracted into a single CSS file](../configurations/extract-css.md).
71+
- By default, contents will be extracted and dynamically inserted into the document's `<head>` as an actual `<style>` tag using `style-loader`. It's also possible to [configure webpack so that all styles in all components are extracted into a single CSS file](../configurations/extract-css.md).
7272

7373
### Custom Blocks
7474

docs/en/workflow/linting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ module.exports = {
3939
}
4040
```
4141

42-
Note that Webpack loader chains are applied **right-first**. Make sure to apply `eslint` before `vue` so we are linting the pre-compile source code.
42+
Note that webpack loader chains are applied **right-first**. Make sure to apply `eslint` before `vue` so we are linting the pre-compile source code.
4343

44-
One thing we need to consider is using third party `*.vue` components shipped in NPM packages. In such case, we want to use `vue-loader` to process the third party component, but do not want to lint it. We can separate the linting into Webpack's [preLoaders](https://webpack.github.io/docs/loaders.html#loader-order):
44+
One thing we need to consider is using third party `*.vue` components shipped in NPM packages. In such case, we want to use `vue-loader` to process the third party component, but do not want to lint it. We can separate the linting into webpack's [preLoaders](https://webpack.github.io/docs/loaders.html#loader-order):
4545

4646
``` js
4747
// webpack.config.js
@@ -67,7 +67,7 @@ module.exports = {
6767
}
6868
```
6969

70-
For Webpack 2.x:
70+
For webpack 2.x:
7171

7272
``` js
7373
// webpack.config.js

docs/en/workflow/production.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
warnings: false
2525
}
2626
}),
27-
// Webpack 1 only - optimize module ids by occurrence count
27+
// webpack 1 only - optimize module ids by occurrence count
2828
new webpack.optimize.OccurrenceOrderPlugin()
2929
]
3030
}
@@ -34,6 +34,6 @@ Obviously we don't want to use this config during development, so there are seve
3434

3535
1. Dynamically build up the configuration object based on an environment variable;
3636

37-
2. Or, use two separate Webpack config files, one for development and one for production. And maybe share some common options between them in a third file, as shown in [vue-hackernews-2.0](https://github.com/vuejs/vue-hackernews-2.0).
37+
2. Or, use two separate webpack config files, one for development and one for production. And maybe share some common options between them in a third file, as shown in [vue-hackernews-2.0](https://github.com/vuejs/vue-hackernews-2.0).
3838

3939
It's really up to you as long as it achieves the goal.

0 commit comments

Comments
 (0)