All Projects → webpack-contrib → Transform Loader

webpack-contrib / Transform Loader

Licence: mit
transform loader for webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Transform Loader

Svg Sprite Webpack Plugin
Webpack plugin for loading/extracting SVGs into a sprite file
Stars: ✭ 73 (-37.07%)
Mutual labels:  webpack-loader
Ignore Loader
Webpack loader to ignore certain package on build.
Stars: ✭ 85 (-26.72%)
Mutual labels:  webpack-loader
Vue Svg Inline Loader
Webpack loader used for inline replacement of SVG images with actual content of SVG files in Vue projects.
Stars: ✭ 105 (-9.48%)
Mutual labels:  webpack-loader
Svg Fill Loader
DEPRECATED, use https://github.com/kisenka/svg-mixer/tree/master/packages/svg-transform-loader instead
Stars: ✭ 74 (-36.21%)
Mutual labels:  webpack-loader
Mini Program Webpack Loader
基于 webpack 的小程序构建工具
Stars: ✭ 83 (-28.45%)
Mutual labels:  webpack-loader
Css Modules Flow Types
Creates flow type definitions from CSS Modules files using Webpack loader or CLI 👾
Stars: ✭ 92 (-20.69%)
Mutual labels:  webpack-loader
Sketch Loader
Webpack loader for Sketch (+43) files
Stars: ✭ 69 (-40.52%)
Mutual labels:  webpack-loader
Vue Theme Loader
A webpack loader for supporting multi-site theming with Vue.js
Stars: ✭ 109 (-6.03%)
Mutual labels:  webpack-loader
Graphql Import Loader
Webpack loader for `graphql-import`
Stars: ✭ 84 (-27.59%)
Mutual labels:  webpack-loader
Url Loader
A loader for webpack which transforms files into base64 URIs
Stars: ✭ 1,361 (+1073.28%)
Mutual labels:  webpack-loader
Node Loader
node loader for native modules
Stars: ✭ 77 (-33.62%)
Mutual labels:  webpack-loader
Sprite Loader
A image sprite loader for webpack.
Stars: ✭ 82 (-29.31%)
Mutual labels:  webpack-loader
Webpack Conditional Loader
C conditionals directive for JavaScript
Stars: ✭ 93 (-19.83%)
Mutual labels:  webpack-loader
Graphql Persisted Document Loader
Webpack loader that adds a documentId to a compiled graphql document, which can be used when persisting/retrieving documents
Stars: ✭ 74 (-36.21%)
Mutual labels:  webpack-loader
Webpack Component Loader
📦 A webpack loader to componentify CSS/JS/HTML without framework
Stars: ✭ 105 (-9.48%)
Mutual labels:  webpack-loader
Jshint Loader
[DEPRECATED] jshint loader for webpack, please migrate on `eslint`
Stars: ✭ 69 (-40.52%)
Mutual labels:  webpack-loader
Worker Loader
A webpack loader that registers a script as a Web Worker
Stars: ✭ 1,284 (+1006.9%)
Mutual labels:  webpack-loader
Sass Vars Loader
Use Sass variables defined in Webpack config or in external Javascript or JSON files
Stars: ✭ 112 (-3.45%)
Mutual labels:  webpack-loader
Webpack Tools
☕️Just a simple webpack sample project.
Stars: ✭ 106 (-8.62%)
Mutual labels:  webpack-loader
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-18.97%)
Mutual labels:  webpack-loader

npm node deps tests coverage chat size

transform-loader

A browserify transformation loader for webpack.

This loader allows use of browserify transforms via a webpack loader.

Getting Started

To begin, you'll need to install transform-loader:

$ npm install transform-loader --save-dev

Note: We're using the coffeeify tranform for these examples.

Then invoke the loader through a require like so:

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

Or add the loader to your webpack config. For example:

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

And run webpack via your preferred method.

QueryString Options

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

Type: String

The name of the browserify transform you wish to use.

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

Type: Number

The index of a function contained within options.transforms which to use to transform the target file(s).

Options

transforms

Type: Array[Function] Default: undefined

An array of functions that can be used to transform a given file matching the configured loader test. For example:

// entry.js
const thing = require('widget/thing');
// webpack.config.js
const through = 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: [
            function transform() {
              return through(
                (buffer) => {
                  const result = buffer
                    .split('')
                    .map((chunk) =>
                      String.fromCharCode(127 - chunk.charCodeAt(0))
                    );
                  return this.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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].