@softvisio/webpack
Version:
Webpack wrapper
13 lines (8 loc) • 348 B
JavaScript
export default async function ( buffer, map, meta ) {
const callback = this.async(),
options = this.getOptions();
if ( this.cacheable ) this.cacheable();
const locale = new options.PoFile( buffer ).toLocale().toJSON();
delete locale.id;
callback( null, `export default ${ JSON.stringify( locale ) }`, map, meta );
}