Open ryerh opened 6 years ago
Xgettext.parseOptions are hard coded here as following:
Xgettext.parseOptions
parser = new Xgettext( { keywords: parserKeywords, parseOptions: { plugins: [ 'jsx', 'classProperties', 'objectRestSpread', 'exportExtensions', 'trailingFunctionCommas', 'asyncFunctions', ], allowImportExportEverywhere: true, } } );
The plugins part is missing some new ES syntax like:
plugins
const GB = 2 ** 10
import('./foo.js').then()
I propose two approach to extend this feature:
parseOptions
$PWD/package.json -> i18nCalypso.parseOptions
Any suggestions? I will open a PR after once an approach has been chosen.
+1 And xgettext-js has the babylon@6.8.4 dependency, which does not support some plugins like dynamicImport etc.
babylon@6.8.4
dynamicImport
Xgettext.parseOptions
are hard coded here as following:The
plugins
part is missing some new ES syntax like:const GB = 2 ** 10
import('./foo.js').then()
I propose two approach to extend this feature:
parseOptions
from$PWD/package.json -> i18nCalypso.parseOptions
, then merge with defaultparseOptions
parseOptions
to keep update with new ES syntaxAny suggestions? I will open a PR after once an approach has been chosen.