traceur-compiler-loader v1.0.6
Up to date Traceur Compiler 0.0.8x loader for Webpack.
Before using
You should manually install "imports-loader" in your project
$ npm install imports-loader
By default traceur-compiler-loader using 0.0.86 version of traceur, but you can manually install any version from 0.0.8x.
IMPORTANT
You should install traceur-compiler before traceur-compiler-loader
if you want use different version on compiler.
Add TRACEUR_RUNTIME
to module.noParse
in webpack.config.js
var TRACEUR_RUNTIME = runtime; moduleexports = //.... module: noParse: TRACEUR_RUNTIME //...;
Usage
// Simple option (does not include Traceur runtime); // Include Traceur runtime automatically; // Specify Traceur options; // All together now;
Recommended configuration (do not process modules)
module: loaders: test: /^+.+\.js$/ loader: 'traceur' noParse: TRACEUR_RUNTIME // With parameters module: loaders: test: /^+.+\.js$/ loader: 'traceur?experimental&runtime' noParse: TRACEUR_RUNTIME
Defaults
// Modules set to CommonJS (consistent with Node.js and Webpack) modules: 'commonjs' // Source maps are built and fed to Webpack (use Webpack options) sourceMaps: true // Traceur runtime by default not auto included runtime: false
Runtime path
Access to the runtime path is available as a direct reference:
require('traceur-compiler-loader').runtime
.
To view all Traceur options, visit here.