Catalog npm
Back to packageRELEASE DETAILS

3.0.0

npm

6to5-loader

6t05 module loader for webpack

6to5es6loadermoduletranspilerwebpack
Published28 Jan 2015
Direct dependencies7
Transitive dependenciesNot calculated

README

Current package documentation

6to5-loader

Turn ES6 code into vanilla ES5 with no runtime required using 6to5;

Notes: Issues with the output should be reported on the 6to5 issue tracker;

Install

$ npm install --save-dev 6to5-loader

Usage

import Animal from '6to5!./Animal.js';

class Person extends Animal {
  constructor(arg='default') {
    this.eat = 'Happy Meal';
  }
}

export default Person;
var Person = require('6to5!./Person.js').default;
new Person();

Or within the webpack config:

module: {
    loaders: [
        { test: /\.js$/, exclude: /node_modules/, loader: '6to5-loader'}
    ]
}

and then import normally:

import Person from './Person.js';

Troubleshooting

6to5-loader is slow!

Make sure you are transforming as few files as possible. Because you are probably matching /\.js$/, you might be transforming the node_modules folder or other unwanted source. See the exclude option in the loaders config as documented above.

6to5 is injecting a runtime into each file and bloating my code!

6to5 uses a very small runtime for common functions such as _extend. By default this will be added to every file that requires it.

You can instead require the 6to5 runtime as a separate module to avoid the duplication.

The following configuration disables automatic per-file runtime injection in 6to5, instead bundling requiring 6to5-runtime and making all helpers use it.

NOTE: You must run npm install 6to5-runtime --save to include this in your project.

loaders: [
  // runtime=true tells 6to5 to expect a runtime, but we still need to bundle it.
  {test: /\.jsx?$/, exclude: /node_modules/, loader: '6to5-loader?experimental&optional=selfContained'}
]

This can save significant overhead if you use 6to5 in many modules.

Options

See the 6to5 options

License

MIT © Luis Couto

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
loader-utils
Environment
{
  "local_name": "loader-utils",
  "alias": false,
  "peer_metadata": null
}
^0.2.5runtime
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
mocha-loader
Environment
{
  "local_name": "mocha-loader",
  "alias": false,
  "peer_metadata": null
}
^0.7.0development
should
Environment
{
  "local_name": "should",
  "alias": false,
  "peer_metadata": null
}
^4.3.1development
webpack-dev-server
Environment
{
  "local_name": "webpack-dev-server",
  "alias": false,
  "peer_metadata": null
}
^1.6.6development
6to5-core
Environment
{
  "local_name": "6to5-core",
  "alias": false,
  "peer_metadata": null
}
^3.0.0peer
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^1.4.5peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "95c04c1992085ed84045e1578ad28c241ac17112",
  "tarball": "https://registry.npmjs.org/6to5-loader/-/6to5-loader-3.0.0.tgz",
  "integrity": "sha512-R4d/gRWV2jtd6nImrp2nomQbL0jsqS+Fs6qgraART4Whjx9oMmmg81gFt2rUG+qFQi/QGnnP3gVEyO4l+frsZQ==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQC81413jOQOFcbpGgpx6gNj9tNNP5ZmXZFhNzrWg/yvwwIhAIPP/N2PhZS21AjjH4K3zQx3ti37P+Imyef8tcM/mbjD"
    }
  ]
}

Repository

PENDING
couto/6to5-loader

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d367f46744955b82bf4ec509b96ed5674ebbb0ec461731b131e63756f0697f78

Other collected versions

2.0.08 Jan1.0.027 Dec0.2.411 Dec0.2.310 Oct0.2.210 Oct0.2.110 OctView all collected versions →