Skip to content

tinkerscript/inject-config-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inject-config-loader

Build Status

inject config into webpack bundle

Install

npm install inject-config-loader --save-dev

or

yarn add -D inject-config-loader

Usage

// webpack.config.js

module.exports = {
  // ...
  resolve: {
    alias: {
      config: path.join(__dirname, 'source/dummy.config')
    }
  },
  module: {
    rules: [
      {
        test: /\.config$/,
        use: [
          {
            loader: 'inject-config-loader',
            options: {
              field: 'front'
            }
          }
        ]
      }
    ]
  },
  // ...
}

Options

field (string)

Name of a config property that will be injected. By default whole config is injected.

cache (bool)

Default value: true (recommended for production). If false, all changes in config files will trigger an incremental build.

Example

See sample webpack.config.js in demo folder.

About

inject config into webpack bundle

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published