Skip to content

Commit

Permalink
Changed loaders to rules in webpack setup (#1185)
Browse files Browse the repository at this point in the history
* Changed loaders to rules in webpack setup

* Added webpack 2 and webpack 1 on build systems
  • Loading branch information
Diogo Ferreira authored and hzoo committed Mar 3, 2017
1 parent d979ccd commit c04178b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _data/tools.yml
Expand Up @@ -20,7 +20,8 @@
requirejs: RequireJS
rollup: Rollup
sprockets: Sprockets
webpack: Webpack
webpack2: Webpack
webpack: Webpack 1
fly: Fly
start: Start
- name: Frameworks
Expand Down
3 changes: 3 additions & 0 deletions _includes/tools/webpack2/install.md
@@ -0,0 +1,3 @@
```sh
npm install --save-dev babel-loader babel-core
```
22 changes: 22 additions & 0 deletions _includes/tools/webpack2/usage.md
@@ -0,0 +1,22 @@
#### Via config

```js
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
}
```

#### Via loader

```js
var Person = require("babel!./Person.js").default;
new Person();
```

<blockquote class="babel-callout babel-callout-info">
<p>
For more information see the <a href="https://github.com/babel/babel-loader">babel/babel-loader repo</a>.
</p>
</blockquote>

0 comments on commit c04178b

Please sign in to comment.