Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 821 Bytes

File metadata and controls

36 lines (26 loc) · 821 Bytes

Preprocessor for Webpack

What it is?

A preprocessor is a tool parsing files and replacing a piece of text by another.

It is extensively used in the C language and in the Unix world in general.

/!\ This is still the early stage of development. preprocessor-loader can only replace __FILE__ and __LINE__ as of this writing.

Ok so, what does it do??

Let's say you have a javascript called index.js like so:

1 'use strict;'
2 console.log('This is a log (__FILE__:__LINE__)');

Once preprocessed, it will produce:

1 'use strict;'
2 console.log('This is a log (index.js:2)');

Usage

{
  test: /\.js$/,
  exclude: /node_modules/
  loader: 'preprocessor',
},