Catalog npm
Back to packageRELEASE DETAILS

0.1.1

npm

6to5-loader

6t05 module loader for webpack

6to5es6loadermoduletranspilerwebpack
Published8 Oct 2014
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
6to5
Environment
{
  "local_name": "6to5",
  "alias": false,
  "peer_metadata": null
}
^1.3.1runtime
loader-utils
Environment
{
  "local_name": "loader-utils",
  "alias": false,
  "peer_metadata": null
}
^0.2.4runtime
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^1.21.4development
mocha-loader
Environment
{
  "local_name": "mocha-loader",
  "alias": false,
  "peer_metadata": null
}
^0.6.5development
should
Environment
{
  "local_name": "should",
  "alias": false,
  "peer_metadata": null
}
^4.0.4development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^1.4.5development
webpack-dev-server
Environment
{
  "local_name": "webpack-dev-server",
  "alias": false,
  "peer_metadata": null
}
^1.6.5development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "605404f50f170edfd829d8d176fb014271395fdd",
  "tarball": "https://registry.npmjs.org/6to5-loader/-/6to5-loader-0.1.1.tgz",
  "integrity": "sha512-80FH2Eo1NQ4vsT+EGzVxoPgUMNX1Sap8vAVO3NBwFasnoUJmETT5sAt1pRG4+UeTTxWhmOG6lEfgbNRtIRKiQg==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQC4Xutce1ixzGB+sr3l5Lo0DSO4bWq3lhIQFy7CDn5nFQIhAPggTtZXPgwnFX3es2Wlv3/2IQsPxujVD4CC+imRR1Ls"
    }
  ]
}

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:55 UTC

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

Record identity

package_version:b7df8241e0416968d9353bfb952fc646a10be6cfbd0c6d4bef4cbdc8bf5aed1d

Other collected versions

3.0.028 Jan2.0.08 Jan1.0.027 Dec0.2.411 Dec0.2.310 Oct0.2.210 OctView all collected versions →