Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

transform loader for webpack

License

NotificationsYou must be signed in to change notification settings

webpack-contrib/transform-loader

Repository files navigation

npmnodedepstestscoveragechatsize

transform-loader

A browserify transformation loader for webpack.

This loader allows use ofbrowserify transforms via a webpack loader.

Getting Started

To begin, you'll need to installtransform-loader:

$npm install transform-loader --save-dev

Note: We're using thecoffeeifytranform for these examples.

Then invoke the loader through a require like so:

constthing=require('!transform-loader?coffeeify!widget/thing');

Or add the loader to yourwebpack config. For example:

// entry.jsimportthingfrom'widget/thing';
// webpack.config.jsmodule.exports={module:{rules:[{test:/\.coffee?$/,loader:`transform-loader?coffeeify`,// options: {...}},],},};

And runwebpack via your preferred method.

QueryString Options

When using the loader via arequire query string you may specify one of twotypes; a loader name, or a function index.

Type:String

The name of thebrowserify transform you wish to use.

Note: You must install the correct transform manually. Webpack nor this loaderwill do that for you.

Type:Number

The index of a function contained withinoptions.transforms which to use totransform the target file(s).

Options

transforms

Type:Array[Function]Default:undefined

An array offunctions that can be used to transform a given file matching theconfigured loadertest. For example:

// entry.jsconstthing=require('widget/thing');
// webpack.config.jsconstthrough=require('through2');module.exports={module:{rules:[{test:/\.ext$/,// NOTE: we've specified an index of 0, which will use the `transform`//       function in `transforms` below.loader:'transform-loader?0',options:{transforms:[functiontransform(){returnthrough((buffer)=>{constresult=buffer.split('').map((chunk)=>String.fromCharCode(127-chunk.charCodeAt(0)));returnthis.queue(result).join('');},()=>this.queue(null));},],},},],},};

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

About

transform loader for webpack

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Contributors13


    [8]ページ先頭

    ©2009-2026 Movatter.jp