@react-aria/optimize-locales-plugin v1.1.0
@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']
})
]
});
2 days ago
6 days ago
7 days ago
8 days ago
8 days ago
9 days ago
10 days ago
13 days ago
14 days ago
16 days ago
17 days ago
18 days ago
20 days ago
21 days ago
22 days ago
24 days ago
27 days ago
28 days ago
29 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago