Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndhoule/webpack-traceur-loader
Webpack loader for Traceur, Google's ES6 to ES5 compiler
https://github.com/ndhoule/webpack-traceur-loader
Last synced: 13 days ago
JSON representation
Webpack loader for Traceur, Google's ES6 to ES5 compiler
- Host: GitHub
- URL: https://github.com/ndhoule/webpack-traceur-loader
- Owner: ndhoule
- License: mit
- Created: 2014-07-08T20:06:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-02T05:36:12.000Z (over 9 years ago)
- Last Synced: 2024-09-18T08:13:22.000Z (2 months ago)
- Language: JavaScript
- Size: 302 KB
- Stars: 10
- Watchers: 3
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Traceur Loader for Webpack
==========================A [Webpack][] loader for transpiling ES6-compatible code to ES5-compatible code using Google's [Traceur][] compiler.
## Installation
```sh
npm install webpack-traceur-loader
```## Usage
### Inline
Requiring files inline:
```javascript
// Simple inline usage
require('webpack-traceur!./src/index');// More advanced version; include the Traceur runtime
require('webpack-traceur!./src/index?runtime');
```[Documentation: Using Loaders][]
### Recommended Configuration
In your `webpack.config.js` file:
```js
module.exports = {
module: {
loaders: [
// Transpile any JavaScript file:
{ test: /\.js$/, loader: 'webpack-traceur' },// Or only those with a specific suffix:
{ test: /\.es6\.js$/, loader: 'webpack-traceur' },// Include the Traceur runtime:
{ test: /\.es6\.js$/, loader: 'webpack-traceur?runtime' },// ...And any other Traceur option you like:
{ test: /\.es6\.js$/, loader: 'webpack-traceur?runtime&sourceMaps&experimental' }
]
}
};
```### Settings
You can set default settings for Traceur in `webpack.config.js`, or in a `require` statement as a querystring.
#### List of Settings
`runtime`: Set to `true` to disable inclusion of the Traceur runtime library in your built file. Defaults to `false`.
All other options are passed directly to to the Traceur compiler. See [this list][Traceur options] for a list of all Traceur options, and see [this guide][ES6 options] for example usages of ES6 features supported by Traceur.
## Demo
See the [`test/demo-app`](test/demo-app) directory for demo of the loader.
## License
MIT ([License](LICENSE.md))
[Documentation: Using Loaders]: http://webpack.github.io/docs/using-loaders.html "Documentation: Using Loaders"
[Traceur]: https://github.com/google/traceur-compiler "Traceur"
[Webpack]: https://webpack.github.io/docs/ "Webpack"
[Traceur options]: https://github.com/google/traceur-compiler/blob/aebf32380cfc70f31e940fc3c9ec26279e10b996/src/options.js#L235
[ES6 options]: https://github.com/google/traceur-compiler/wiki/LanguageFeatures