traceur-loader
v0.6.3
Published
Traceur loader for Webpack
Downloads
73
Readme
traceur-loader 0.6.3
Traceur 0.0.72 loader for Webpack.
Usage
// Simple option (does not include Traceur runtime)
require("traceur!./script-file");
// Include Traceur runtime automatically
require("traceur?runtime!./script-file");
// Specify Traceur options
require("traceur?experimental&symbols!./script-file");
// All together now
require("traceur?runtime&symbols!./script-file");
Recommended configuration (do not process modules)
{
module: {
loaders: [
{
test: /^(?!.*(bower_components|node_modules))+.+\.js$/,
loader: 'traceur'
}
]
}
}
// With parameters
{
module: {
loaders: [
{
test: /^(?!.*(bower_components|node_modules))+.+\.js$/,
loader: 'traceur?experimental&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-loader').runtime
.
To view all Traceur options, visit here.