4.0.0 • Published 6 years ago

exec-loader v4.0.0

Weekly downloads
15
License
MIT
Repository
github
Last release
6 years ago

exec-loader Build Status

Webpack loader to execute imports at build time.

Simply runs the source through this.exec and exports the result.

Installation

npm install --save-dev exec-loader

Usage

latestRevision.js:

var child_process = require('child_process');

module.exports = child_process.execSync('git describe', { encoding: 'utf8' }).trim();

example.js:

import revision from 'exec-loader!./latestRevision';
// revision === 'v1.0.0'

// to cache the result in watch mode
import revision from 'exec-loader?cache!./latestRevision';

// to generate `module.exports` instead of ES6 exports (useful in rare circumstances)
var revision = require('exec-loader?export=commonjs!./latestRevision');
4.0.0

6 years ago

3.0.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago