Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept a JS module as value for --config #263

Open
DamienCassou opened this issue Nov 15, 2024 · 1 comment
Open

Accept a JS module as value for --config #263

DamienCassou opened this issue Nov 15, 2024 · 1 comment

Comments

@DamienCassou
Copy link

🚀 Feature Proposal

The --config option of the command line interface doesn't accept module JS files (those using import and export).

Motivation

My whole project is written as modules and I have the impression the whole JS ecosystem is moving toward using them.

Example

We could have a configuration file i18next-scanner.js such as:

import { defaultNS, fallbackLng } from "./src/i18n/globals.cjs";
import fs from "node:fs";

const scannerConfig = {
  input: [
    "src/app/**/*.{js,jsx}",
  ],
  defaultNs: defaultNS,
  ...
};

export default scannerConfig;

and use it like this:

$ i18next-scanner --config i18next-scanner.js
@DamienCassou
Copy link
Author

A PR was opened to do just that a long time ago: #155. It was closed without explanation though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant