0.2.3 • Published 5 years ago

search-loader v0.2.3

Weekly downloads
9
License
ISC
Repository
github
Last release
5 years ago

search-loader

Search across webpack resources

Installation

npm i --save-dev search-loader

Usage

Add the search loader configuration to the beginning of any loader chain to search among that file type

const webpackConfiguration = {
  // ...
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          {loader: 'babel-loader'},
          {
            loader: 'search-loader',
            options: {
              regex: new RegExp(/test/, 'g'),
              output: path.resolve(__dirname, 'search/output.json'),
              verbose: false,
            },
          },
        ],
      },
      // ...
    ],
  },
  //...
}

Options

  • regex: A regular expression to apply to the source. Don't forget the 'g' flag if you want to find all matches within a source file.
  • output: An absolute file path to store the search results.
  • verbose: Prints out search results and other debugging messages.
0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago