All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.rollup_plugin_minify_style_spec.js Maven / Gradle / Ivy

The newest version!

function replacer(k, v) {
    return (k === 'doc' || k === 'example' || k === 'sdk-support') ? undefined : v;
}

export default function minifyStyleSpec() {
    return {
        name: 'minify-style-spec',
        transform: (source, id) => {
            if (!/style\-spec[\\/]reference[\\/]v[0-9]+\.json$/.test(id)) {
                return;
            }

            const spec = JSON.parse(source);

            delete spec['expression_name'];

            return {
                code: JSON.stringify(spec, replacer, 0),
                map: {mappings: ''}
            };
        }
    };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy