Skip to content

Commit

Permalink
fix(language-features): Drop webpack alias bit
Browse files Browse the repository at this point in the history
There's an entire book for that.
  • Loading branch information
bebraw committed Mar 7, 2018
1 parent 735635e commit 15e9271
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions manuscript/appendices/01_language_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ import {actions as TodoActions} from '../actions/todo'

`as` allows you to avoid naming conflicts.

### Webpack `resolve.alias`

Bundlers, such as Webpack, can provide some features beyond this. You could define a `resolve.alias` for some of your module directories for example. This would allow you to use an import, such as `import persist from 'libs/persist';`, regardless of where you import. A simple `resolve.alias` could look like this:

```javascript
...
resolve: {
alias: {
libs: path.join(__dirname, 'libs')
}
}
```

The official documentation describes [possible variants](https://webpack.github.io/docs/configuration.html#resolve-alias) in fuller detail.

## Classes

Unlike many other languages out there, JavaScript uses prototype based inheritance instead of class based one. Both approaches have their merits. In fact, you can mimic a class based model through a prototype based one. ES6 classes are about providing syntactical sugar above the basic mechanisms of JavaScript. Internally it still uses the same old system. It just looks a little different to the programmer.
Expand Down

0 comments on commit 15e9271

Please sign in to comment.