Babel plugin to extract string from js source file then save into array
API
import { transform } from 'babel-core'
import extractString from 'babel-plugin-extract-string'
const result = transform(sourceCode, {
plugins: [ [extractString, {name: 'abc'}] ]
})
console.log(result.code)
{
"presets": ["es2015"],
"plugins": [ ["extract-string", {"name": "abc"}] ]
}
OPTIONS
{...}
have below keys
Array name to place into code, replace the position of each string, as arrayName[index]
Don't touch string length less than minLength
Output file to store extracted string (as json array)