File: build

package info (click to toggle)
node-i18next-http-backend 2.4.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: javascript: 1,355; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# build cjs files
rm -rf cjs/*
BABEL_ENV=cjs babeljs lib -d cjs
echo '{\"type\":\"commonjs\"}' > cjs/package.json && cp lib/getFetch.cjs cjs/getFetch.js
node -e "fs.writeFileSync('cjs/request.js', fs.readFileSync('cjs/request.js').toString().replace('getFetch.cjs', 'getFetch.js'))"

# build esm files
rm -rf esm/*
BABEL_ENV=esm babeljs lib -d esm
cp lib/getFetch.cjs esm/getFetch.cjs
rm -f esm/getFetch.js

# build browser files
browserify-lite ./cjs/index.js --outfile i18nextHttpBackend.js --standalone i18nextHttpBackend
terser i18nextHttpBackend.js -o i18nextHttpBackend.min.js