Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alienfast/i18next-loader

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alienfast/i18next-loader - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "@alienfast/i18next-loader",
"version": "1.0.5",
"version": "1.0.6",
"description": "Webpack loader for client embedded i18next locales from json or yaml.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -35,7 +35,39 @@ # @alienfast/i18next-loader

### Sample i18next config/use
### Option 1: use with webpack.config.js (recommended)
```javascript
module.exports = {
// ... snip
module: {
rules: [
{
test: /locales/,
loader: '@alienfast/i18next-loader',
// options here
//query: { overrides: [ '../node_modules/lib/locales' ] }
}
]
}
// ... snip
}
```
```javascript
// File: app.js
import i18n from 'i18next'
import resources from '../locales'
i18n.init({
resources
});
// Use the resources as documented on i18next.com
i18n.t('key')
```
### Option 2: use with import syntax
```javascript
// File: app.js
import i18n from 'i18next'
import resources from '@alienfast/i18next-loader!../locales/index.js'

@@ -55,2 +87,4 @@

Options are set via the loader `query`. See webpack documentation for more details regarding how this mechanism works.
The following examples assume you understand these values are used as the `query` value.

@@ -63,9 +97,9 @@ ### Filtering files

#### Only json
```javascript
import resources from "@alienfast/i18next-loader?{include: ['**/*.json']}!../locales/index.js"
```json
{include: ['**/*.json']}
```
#### Json but exclude one file
```javascript
import resources from "@alienfast/i18next-loader?{include: ['**/*.json', '!**/excludeThis.json']}!../locales/index.js"
```json
{include: ['**/*.json', '!**/excludeThis.json']}
```

@@ -77,4 +111,4 @@

```javascript
import resources from "@alienfast/i18next-loader?{overrides: ['../node_modules/lib1/locales']}!../locales/index.js"
```json
{overrides: ['../node_modules/lib1/locales']}
```

@@ -81,0 +115,0 @@ This configures the loader to work on a file structure like the following:

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