From 4a23ad0509e155313b9839f9ce4397439e56d666 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 25 Jul 2017 04:54:42 +0200 Subject: [PATCH] docs(getting-started): refine module section (#1450) Refine module section and bring together related sentences. Add links to further documentation. --- content/guides/getting-started.md | 8 +++++--- content/loaders/index.md | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/content/guides/getting-started.md b/content/guides/getting-started.md index 5fb18bb51cf6..1ba4171d5a9e 100644 --- a/content/guides/getting-started.md +++ b/content/guides/getting-started.md @@ -160,11 +160,13 @@ T> Your output may vary a bit, but if the build is successful then you are good Open `index.html` in your browser and, if everything went right, you should see the following text: 'Hello webpack'. -## ES2015 Modules +## Modules -Although `import` and `export` statements are not supported in most browsers (yet), webpack does support them. Behind the scenes, webpack actually "transpiles" the code so that older browsers can also run it. If you inspect `dist/bundle.js`, you might be able to see how webpack does this, it's quite ingenious! +The [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) and [`export`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) statements have been standardized in [ES2015](https://babeljs.io/learn-es2015/). Although they are not supported in most browsers yet, webpack does support them out of the box. -Note that webpack will not alter any code other than `import` and `export` statements. If you are using other [ES2015 features](http://es6-features.org/), make sure to use a transpiler such as [Babel](https://babeljs.io/) or [Bublé](https://buble.surge.sh/guide/). See our [Module API](/api/module-methods) documentation for information on the various module syntaxes supported by webpack. +Behind the scenes, webpack actually "transpiles" the code so that older browsers can also run it. If you inspect `dist/bundle.js`, you might be able to see how webpack does this, it's quite ingenious! Besides `import` and `export`, webpack supports various other module syntaxes as well, see [Module API](/api/module-methods) for more information. + +Note that webpack will not alter any code other than `import` and `export` statements. If you are using other [ES2015 features](http://es6-features.org/), make sure to [use a transpiler](/loaders/#transpiling) such as [Babel](https://babeljs.io/) or [Bublé](https://buble.surge.sh/guide/) via webpack's [loader system](/concepts/loaders/). ## Using a Configuration diff --git a/content/loaders/index.md b/content/loaders/index.md index 25e4a52be34e..38fe849649d7 100644 --- a/content/loaders/index.md +++ b/content/loaders/index.md @@ -30,6 +30,7 @@ Loaders are activated by using `loadername!` prefixes in `require()` statements, * [`script-loader`](/loaders/script-loader) Executes a JavaScript file once in global context (like in script tag), requires are not parsed * [`babel-loader`](/loaders/babel-loader) Loads ES2015+ code and transpiles to ES5 using [Babel](https://babeljs.io/) +* `buble-loader` Loads ES2015+ code and transpiles to ES5 using [Bublé](https://buble.surge.sh/guide/) * `traceur-loader` Loads ES2015+ code and transpiles to ES5 using [Traceur](https://github.com/google/traceur-compiler#readme) * [`ts-loader`](https://github.com/TypeStrong/ts-loader) or [`awesome-typescript-loader`](https://github.com/s-panferov/awesome-typescript-loader) Loads [TypeScript](https://www.typescriptlang.org/) 2.0+ like JavaScript * [`coffee-loader`](/loaders/coffee-loader) Loads [CoffeeScript](http://coffeescript.org/) like JavaScript