deprecated-loader

0.0.4 • Public • Published

npm node size tests

deprecated-loader

The deprecated-loader notifies deprecated code.

Getting Started

To begin, you'll need to install deprecated-loader:

$ npm install deprecated-loader --save-dev

Then add the loader to your webpack config. For example:

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/i,
        use: [
          {
            loader: 'deprecated-loader'
          }
        ]
      }
    ]
  }
}

Use comment @deprecated [2.0.0] in your code. In square brackets, indicate the version after which the code should be removed:

file.js

/**
 * @deprecated [2.0.0]
 */
console.log('Some code')

And run webpack via your preferred method. If the version of the app in package.json is greater than or equal to the version of the code, you will see comments in the terminal:

WARNING in ./file.js
Module Warning (from ./file.js):
 
----------------
line: 13
text: @deprecated [2.0.0]
----------------
 

Options

notification

Enum: warning|error|none - default: 'warning'

Deprecated code notification type

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/i,
        use: [
          {
            loader: 'deprecated-loader',
            options: {
              notification: 'error'
            }
          }
        ]
      }
    ]
  }
}

License

MIT

/deprecated-loader/

    Package Sidebar

    Install

    npm i deprecated-loader

    Weekly Downloads

    0

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    9.79 kB

    Total Files

    15

    Last publish

    Collaborators

    • novavovikov