New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-aria/optimize-locales-plugin

Package Overview
Dependencies
Maintainers
0
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/optimize-locales-plugin

A build plugin to optimize React Aria to only include translated strings for locales that your app supports. It currently supports Vite, Rollup, Webpack, and esbuild via [unplugin](https://github.com/unjs/unplugin). For Parcel, please use `@react-aria/par

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by7.26%
Maintainers
0
Weekly downloads
 
Created
Source

@react-aria/optimize-locales-plugin

A build plugin to optimize React Aria to only include translated strings for locales that your app supports. It currently supports Vite, Rollup, Webpack, and esbuild via unplugin. For Parcel, please use @react-aria/parcel-resolver-optimize-locales.

Configuration

Any strings for locales other than the ones listed in the configuration as shown below will be removed from your bundle. See the documentation for a full list of supported locales.

webpack

// webpack.config.js
const optimizeLocales = require('@react-aria/optimize-locales-plugin');

module.exports = {
  // ...
  plugins: [
    optimizeLocales.webpack({
      locales: ['en-US', 'fr-FR']
    })
  ]
};

Next.js

// next.config.js
const optimizeLocales = require('@react-aria/optimize-locales-plugin');

module.exports = {
  webpack(config) {
    config.plugins.push(
      optimizeLocales.webpack({
        locales: ['en-US', 'fr-FR']
      })
    );
    return config;
  }
};

Vite

// vite.config.js
import optimizeLocales from '@react-aria/optimize-locales-plugin';

export default {
  plugins: [
    optimizeLocales.vite({
      locales: ['en-US', 'fr-FR']
    })
  ]
};

Rollup

// rollup.config.js
import optimizeLocales from '@react-aria/optimize-locales-plugin';

export default {
  plugins: [
    optimizeLocales.rollup({
      locales: ['en-US', 'fr-FR']
    })
  ]
};

Esbuild

import {build} from 'esbuild';
import optimizeLocales from '@react-aria/optimize-locales-plugin';

build({
  plugins: [
    optimizeLocales.esbuild({
      locales: ['en-US', 'fr-FR']
    })
  ]
});

FAQs

Package last updated on 15 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc