Skip to content

Commit

Permalink
feat: ie11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dfdgsdfg committed Nov 23, 2018
1 parent 9df3ec2 commit b259f1b
Show file tree
Hide file tree
Showing 9 changed files with 2,494 additions and 895 deletions.
10 changes: 7 additions & 3 deletions .babelrc
@@ -1,12 +1,16 @@
{
"sourceMaps": true,
"presets": [
[
"@babel/preset-env",
{
"targets": {
"ie": "11"
}
"ie": "11",
"browsers": "last 2 versions"
},
"useBuiltIns": "usage"
}
]
]
],
"ignore": [ "node_modules" ]
}
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -120,15 +120,15 @@ function DocumentLang(langsSet, userLang) {
const langs = Array.from(langsSet);
let cur = langs.indexOf(userLang);
const next = () => {
if (cur <= langs.length - 1) {
if (cur < langs.length) {
return langs[cur++];
} else {
cur = 0;
return langs[0];
}
};
const nextVal = () => {
if (cur + 1 <= langs.length - 1) {
if (cur + 1 < langs.length) {
return langs[cur + 1];
} else {
return langs[0];
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "webflow-multilingual",
"version": "0.0.3",
"version": "0.0.4",
"description": "webflow multilingual library",
"main": "webflow-multilingual.js",
"scripts": {
Expand All @@ -23,10 +23,10 @@
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"husky": "^1.1.4",
"husky": "^1.2.0",
"prettier": "1.15.2",
"pretty-quick": "^1.8.0",
"rollup": "^0.67.1",
"rollup": "^0.67.3",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-livereload": "^0.6.0",
Expand Down
25 changes: 5 additions & 20 deletions rollup.config.prod.js
@@ -1,9 +1,9 @@
// import { terser } from "rollup-plugin-terser";
import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
import babel from 'rollup-plugin-babel'
import babel from "rollup-plugin-babel";

export default [
export default [
{
input: "index.js",
output: [
Expand All @@ -13,15 +13,7 @@ export default [
name: "wm"
}
],
plugins: [
resolve({
jsnext: true,
main: true,
browser: true
}),
commonjs({ include: "node_modules/**" }),
babel()
]
plugins: [babel(), resolve(), commonjs()]
},
{
input: "index.js",
Expand All @@ -31,13 +23,6 @@ export default [
format: "es"
}
],
plugins: [
resolve({
jsnext: true,
main: true,
browser: true
}),
commonjs({ include: "node_modules/**" }),
]
plugins: [resolve(), commonjs()]
}
]
];

0 comments on commit b259f1b

Please sign in to comment.