0.1.2 • Published 1 year ago

@othercommerce/vite-plugin-features v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Vite Plugin Features

This plugin generates a virtual module $features which provides a list of all configured OtherCommerce features and their availability states.

Example usage:

import { Features } from '$features';

if (Features.affiliateProgram.isEnabled()) {
  // Do something only when certail feature is enabled...
}

if (Features.affiliateProgram.isDisabled()) {
  // Do something only when certail feature is disabled...
}

When you're using @othercommerce/vite-storefront plugin you can also use global component property within Vue components templates:

<script setup>
  defineProps({
    points: { type: Number, required: false, default: 0 },
  });
</script>
<template>
  <div v-if="$features.loyaltyPoints.isEnabled() && points > 0">
    Available points: {{ points }}.
  </div>
</template>
0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago