Skip to content

Commit

Permalink
馃摝 add polyfills and refactor package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin L枚ffel committed Dec 29, 2018
1 parent 708cf48 commit 33953b9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
12 changes: 8 additions & 4 deletions package.json
Expand Up @@ -4,10 +4,12 @@
"author": "Robin L枚ffel <hi@robinloeffel.ch> (https://robinloeffel.ch)",
"version": "0.2.1",
"license": "MIT",
"homepage": "https://robinloeffel.ch/misc/mehrsprachig",
"homepage": "https://dev.robinloeffel.ch/mehrsprachig",
"repository": "rbnlffl/mehrsprachig",
"module": "dist/mehrsprachig.es.js",
"browser": "dist/mehrsprachig.umd.js",
"main": "dist/mehrsprachig.umd.js",
"unpkg": "dist/mehrsprachig.umd.js",
"module": "dist/mehrsprachig.esm.js",
"jsnext:main": "dist/mehrsprachig.esm.js",
"files": [
"dist/mehrsprachig.*"
],
Expand All @@ -26,13 +28,15 @@
"@babel/preset-env": "^7.2.0",
"babel-eslint": "^10.0.1",
"npm-run-all": "^4.1.5",
"promise-polyfill": "^8.1.0",
"rollup": "^0.68.0",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-eslint": "^5.0.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-uglify": "^6.0.0",
"serve": "^10.1.1"
"serve": "^10.1.1",
"whatwg-fetch": "^3.0.0"
},
"scripts": {
"build": "rollup -c",
Expand Down
5 changes: 3 additions & 2 deletions rollup.config.js
Expand Up @@ -3,6 +3,7 @@ import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { uglify } from 'rollup-plugin-uglify';
import { eslint } from 'rollup-plugin-eslint';
import pkg from './package.json';

// two separate objects for two separate outputs
// firstly esnext for bundlers, then umd for browsers
Expand All @@ -16,7 +17,7 @@ export default [{
output: {
dir: 'dist',
sourcemap: true,
file: 'mehrsprachig.es.js',
file: pkg.module,
format: 'es'
}
}, {
Expand All @@ -32,7 +33,7 @@ export default [{
dir: 'dist',
sourcemap: true,
name: 'Mehrsprachig',
file: 'mehrsprachig.umd.js',
file: pkg.browser,
format: 'umd'
}
}];
3 changes: 3 additions & 0 deletions src/mehrsprachig.js
@@ -1,3 +1,6 @@
import 'whatwg-fetch';
import 'promise-polyfill/src/polyfill';

class Mehrsprachig {
constructor({
language = 'browser',
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Expand Up @@ -2174,6 +2174,11 @@ progress@^2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=

promise-polyfill@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.0.tgz#30059da54d1358ce905ac581f287e184aedf995d"
integrity sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA==

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
Expand Down Expand Up @@ -2747,6 +2752,11 @@ vary@~1.1.2:
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=

whatwg-fetch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==

which@^1.2.9:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
Expand Down

0 comments on commit 33953b9

Please sign in to comment.