0.0.3 • Published 6 years ago

@rabbitcc/pods-webpack-plugin v0.0.3

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
6 years ago

pods-webpack-plugin

convert pods file struct, e.g.

import style from '@/style/foo'

will convert to

import style from './foo/style.css'

usage

const PodsWebpackPlugin = require('@rabbitcc/pods-webpack-plugin')

module.exports = {
  //...
  plugins: [
    new PodsWebpackPlugin({ /* options */ })
  ]
}

interface

type Options = {
  prefix: string = '@',                    // prefix flag, e.g. `import foo from '@/bar'`
  context: string = '',                    // default to use compiler.context
  warning: boolean = true,                 // print warning
  dir: Array<string | [string, string]>    // define alias, e.g. dir: ['foo', ['bar', 'css']]
}

The dir item shoule be a string or a tuple, if dir item was a tuple, the second element was extname.