0.4.4 • Published 5 years ago

webpack-transform-modules-plugin v0.4.4

Weekly downloads
1,251
License
MIT
Repository
github
Last release
5 years ago

webpack-transform-modules-plugin Build Status codecov.io

A webpack plugin for babel-plugin-transform-modules. It is used to handle babel-plugin-transform-modules 'transform-modules' options in node_modules.

Note: This plugin only works with babel-loader and vue-loader.

Install

npm i webpack-transform-modules-plugin --save-dev

Usage

var TransformModulesPlugin = require('webpack-transform-modules-plugin')

module.exports = {
  // ...
  module: {
    rules: [
      // ...
      {
        test: /\.js$/,
        loader: 'babel-loader'
        // this plugin will be include the packages "transformModules" config
        // eg: {"transformModules": {"a": {...}}} // in package.json
        // the current rule's options plugins will be like: 
        /*
         `[require('babel-plugin-transform-modules'), {
            'a': {
              ...
            }
          }]`
         */
      }
      // ...
    ]
  },
  plugins: [
    new TransformModulesPlugin()
  ]
}

Options

new TransformModulesPlugin({
  transformModules: {
    a: {
      transform: 'a/${member}'
    },
    b: null
  }
})

In this demo, this plugin will load a and b packages "transformModules" config in each package.json and it will load sub packages "transformModules" configs too.

  • transformModules {Object} default undefined, application init babel-plugin-transform-modules 'transform-modules' options, if it is undefined then this plugin will get transformModules value in package.json as the init config.
0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago