mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-07 22:46:36 +02:00
18 lines
440 B
JavaScript
18 lines
440 B
JavaScript
const { getOptions } = require( 'loader-utils' );
|
|
const { AutomatonWithGUI } = require( '@fms-cat/automaton-with-gui' );
|
|
|
|
/**
|
|
* @param {string} content
|
|
*/
|
|
module.exports = function( content ) {
|
|
const options = getOptions( this );
|
|
|
|
let data = JSON.parse( content );
|
|
|
|
if ( options.minimize ) {
|
|
data = AutomatonWithGUI.minimizeData( data, { ...options.minimize } );
|
|
}
|
|
|
|
return `module.exports = ${ JSON.stringify( data ) }`;
|
|
};
|