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

Output ES5 version and use it as main #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["env"],
"plugins": [
["transform-es2015-spread", { "loose": true }],
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated files
punycode.es6.js
punycode.es5.js

# Coverage report
coverage
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.1.1",
"description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.",
"homepage": "https://mths.be/punycode",
"main": "punycode.js",
"main": "punycode.es5.js",
"jsnext:main": "punycode.es6.js",
"module": "punycode.es6.js",
"engines": {
Expand Down Expand Up @@ -37,13 +37,18 @@
"files": [
"LICENSE-MIT.txt",
"punycode.js",
"punycode.es6.js"
"punycode.es6.js",
"punycode.es5.js"
],
"scripts": {
"test": "mocha tests",
"prepublish": "node scripts/prepublish.js"
"build": "babel punycode.js --out-file punycode.es5.js",
"prepublish": "npm run build && node scripts/prepublish.js"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-preset-env": "^1.7.0",
"codecov": "^1.0.1",
"istanbul": "^0.4.1",
"mocha": "^2.5.3"
Expand Down