sozialhelden / ietf-language-tags Goto Github PK
View Code? Open in Web Editor NEWAn NPM module that helps you working with IETF language tags as specified by BCP 47 / RFC 5646.
License: Other
An NPM module that helps you working with IETF language tags as specified by BCP 47 / RFC 5646.
License: Other
To reduce bundle size
npm install --save @sozialhelden/ietf-language-tags
> @sozialhelden/[email protected] postinstall /Users/project/functions/node_modules/@sozialhelden/ietf-language-tags
> cp -r ./node_modules/language-subtag-registry/data/json ./src
cp: ./node_modules/language-subtag-registry/data/json: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @sozialhelden/[email protected] postinstall: `cp -r ./node_modules/language-subtag-registry/data/json ./src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @sozialhelden/[email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Doesn't work even if I install language-subtag-registry
separately on the same directory.
TypeScript fails to work properly with this package at the moment because the module
and types
property of the distributed package.json
are pointing to non-existent properties.
(PR to come later)
When you upgrade your packages later on, this shouldn't break anything, and requires no modification of your code or the installed package.
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false,
"esModuleInterop": true,
"paths": {
"@sozialhelden/ietf-language-tags": [
"./node_modules/@sozialhelden/ietf-language-tags/dist/esm/index.js"
],
}
}
}
This has the undesirable side effect of adding many ../../
to your code...
import {
normalizeLanguageTagCasing,
parseLanguageTag,
} from '../../node_modules/@sozialhelden/ietf-language-tags/dist/esm/';
If you update node_modules/@sozialhelden/ietf-language-tags/package.json
to use the esm outputs, typescript works properly, but this affects the ability to use npm install
, so it may not be preferable, esp in CI/CD environments.
{
"module": "dist/esm/index.js",
"types": "./dist/esm/index.d.ts"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.