Skip to content

wevns/preprocess-webpack-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@wevns/preprocess-webpack-loader

This package provides a loader for webpack that runs files through preprocess, allowing you to create preprocessor directives in your program!

This package exists because preprocess-loader uses an outdated version of preprocess.

Installation

npm i -D @wevns/preprocess-webpack-loader

or

yarn add -D @wevns/preprocess-webpack-loader

Usage

Add it to your existing rules

module.exports = {
  module: {
    rules: [
      {
        test: /\.[tj]sx?$/,
        use: [
          // your existing loaders...
          {
            loader: '@wevns/preprocess-webpack-loader',
            options: {
              // this is optional,
              // preprocess auto detects this using the
              // file's extension but you can also
              // explicitly state it!
              type: 'js',
              context: {
                // by default context already contains all your
                // environment variables
                DEV_MODE: true,
              },
            },
          },
        ],
      },
    ],
  },
};

Preprocess doesn'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published