text-extractify

0.1.0 • Public • Published

Browserify plugin to extract text into standalone files

In order to extract text from a file the file should be transformed into a JS module that doesn't require anything and exports the text as module.exports. Files transformed with stringify are suitable to be used with text-extractify.

Usage

import extractify from 'text-extractify';
 
browserify(entry, opts)
    .transform(stringify(['.css']))
    .plugin(extractify, opts)
    .bundle();

Options

  • dest - Output filename for the extracted file
  • [exts=[]] - List of extensions of files that should be extracted.

Complete example

import extractify from 'text-extractify';
import stringify from 'stringify';
import lessify from 'node-lessify';
 
browserify(entry, opts)
    .transform(stringify(['.css']))
    .transform(lessify, { textMode : true })
    .plugin(extractify, {
        exts : ['less', 'css'],
        dest : 'style.css',
    })
    .bundle();

Readme

Keywords

none

Package Sidebar

Install

npm i text-extractify

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • tiddo