Skip to content

Commit 9011557

Browse files
author
kristinn93
committed
adding babel loader
1 parent 9b210e0 commit 9011557

File tree

5 files changed

+100
-25
lines changed

5 files changed

+100
-25
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"env"
4+
]
5+
}

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "postal-codes-js",
33
"version": "1.0.0",
44
"description": "Postal Codes",
5-
"main": "dist/postal-codes-js.js",
5+
"main": "dist/index.js",
66
"scripts": {
77
"build": "webpack index.js --mode production",
88
"coverage": "istanbul cover _mocha -- -R spec",
@@ -23,6 +23,9 @@
2323
"path": "^0.12.7"
2424
},
2525
"devDependencies": {
26+
"babel-core": "6.26.0",
27+
"babel-loader": "7.1.4",
28+
"babel-preset-env": "1.6.1",
2629
"chai": "^4.1.2",
2730
"coveralls": "^2.11.8",
2831
"istanbul": "^0.4.2",

webpack.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ module.exports = {
66
library: "postal-codes-js",
77
filename: "index.js"
88
},
9-
devtool: false,
9+
module: {
10+
rules: [
11+
{
12+
test: /\.js$/,
13+
use: {
14+
loader: "babel-loader"
15+
}
16+
}
17+
]
18+
},
1019
target: "web"
1120
};

yarn.lock

+80-22
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ babel-code-frame@^6.26.0:
237237
esutils "^2.0.2"
238238
js-tokens "^3.0.2"
239239

240-
babel-core@^6.26.0:
240+
babel-core@6.26.0, babel-core@^6.26.0:
241241
version "6.26.0"
242242
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8"
243243
dependencies:
@@ -392,6 +392,14 @@ babel-helpers@^6.24.1:
392392
babel-runtime "^6.22.0"
393393
babel-template "^6.24.1"
394394

395+
396+
version "7.1.4"
397+
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.4.tgz#e3463938bd4e6d55d1c174c5485d406a188ed015"
398+
dependencies:
399+
find-cache-dir "^1.0.0"
400+
loader-utils "^1.0.2"
401+
mkdirp "^0.5.1"
402+
395403
babel-messages@^6.23.0:
396404
version "6.23.0"
397405
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
@@ -456,7 +464,7 @@ babel-plugin-transform-async-generator-functions@^6.24.1:
456464
babel-plugin-syntax-async-generators "^6.5.0"
457465
babel-runtime "^6.22.0"
458466

459-
babel-plugin-transform-async-to-generator@^6.24.1:
467+
babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1:
460468
version "6.24.1"
461469
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
462470
dependencies:
@@ -503,7 +511,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
503511
dependencies:
504512
babel-runtime "^6.22.0"
505513

506-
babel-plugin-transform-es2015-block-scoping@^6.24.1:
514+
babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1:
507515
version "6.26.0"
508516
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"
509517
dependencies:
@@ -513,7 +521,7 @@ babel-plugin-transform-es2015-block-scoping@^6.24.1:
513521
babel-types "^6.26.0"
514522
lodash "^4.17.4"
515523

516-
babel-plugin-transform-es2015-classes@^6.24.1:
524+
babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1:
517525
version "6.24.1"
518526
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
519527
dependencies:
@@ -527,33 +535,33 @@ babel-plugin-transform-es2015-classes@^6.24.1:
527535
babel-traverse "^6.24.1"
528536
babel-types "^6.24.1"
529537

530-
babel-plugin-transform-es2015-computed-properties@^6.24.1:
538+
babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1:
531539
version "6.24.1"
532540
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
533541
dependencies:
534542
babel-runtime "^6.22.0"
535543
babel-template "^6.24.1"
536544

537-
babel-plugin-transform-es2015-destructuring@^6.22.0:
545+
babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0:
538546
version "6.23.0"
539547
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
540548
dependencies:
541549
babel-runtime "^6.22.0"
542550

543-
babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
551+
babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
544552
version "6.24.1"
545553
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
546554
dependencies:
547555
babel-runtime "^6.22.0"
548556
babel-types "^6.24.1"
549557

550-
babel-plugin-transform-es2015-for-of@^6.22.0:
558+
babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0:
551559
version "6.23.0"
552560
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
553561
dependencies:
554562
babel-runtime "^6.22.0"
555563

556-
babel-plugin-transform-es2015-function-name@^6.24.1:
564+
babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1:
557565
version "6.24.1"
558566
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
559567
dependencies:
@@ -567,15 +575,15 @@ babel-plugin-transform-es2015-literals@^6.22.0:
567575
dependencies:
568576
babel-runtime "^6.22.0"
569577

570-
babel-plugin-transform-es2015-modules-amd@^6.24.1:
578+
babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1:
571579
version "6.24.1"
572580
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154"
573581
dependencies:
574582
babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
575583
babel-runtime "^6.22.0"
576584
babel-template "^6.24.1"
577585

578-
babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
586+
babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
579587
version "6.26.0"
580588
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a"
581589
dependencies:
@@ -584,30 +592,30 @@ babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
584592
babel-template "^6.26.0"
585593
babel-types "^6.26.0"
586594

587-
babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
595+
babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
588596
version "6.24.1"
589597
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
590598
dependencies:
591599
babel-helper-hoist-variables "^6.24.1"
592600
babel-runtime "^6.22.0"
593601
babel-template "^6.24.1"
594602

595-
babel-plugin-transform-es2015-modules-umd@^6.24.1:
603+
babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1:
596604
version "6.24.1"
597605
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
598606
dependencies:
599607
babel-plugin-transform-es2015-modules-amd "^6.24.1"
600608
babel-runtime "^6.22.0"
601609
babel-template "^6.24.1"
602610

603-
babel-plugin-transform-es2015-object-super@^6.24.1:
611+
babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1:
604612
version "6.24.1"
605613
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
606614
dependencies:
607615
babel-helper-replace-supers "^6.24.1"
608616
babel-runtime "^6.22.0"
609617

610-
babel-plugin-transform-es2015-parameters@^6.24.1:
618+
babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1:
611619
version "6.24.1"
612620
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
613621
dependencies:
@@ -618,7 +626,7 @@ babel-plugin-transform-es2015-parameters@^6.24.1:
618626
babel-traverse "^6.24.1"
619627
babel-types "^6.24.1"
620628

621-
babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
629+
babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
622630
version "6.24.1"
623631
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
624632
dependencies:
@@ -631,7 +639,7 @@ babel-plugin-transform-es2015-spread@^6.22.0:
631639
dependencies:
632640
babel-runtime "^6.22.0"
633641

634-
babel-plugin-transform-es2015-sticky-regex@^6.24.1:
642+
babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1:
635643
version "6.24.1"
636644
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
637645
dependencies:
@@ -645,21 +653,21 @@ babel-plugin-transform-es2015-template-literals@^6.22.0:
645653
dependencies:
646654
babel-runtime "^6.22.0"
647655

648-
babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
656+
babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0:
649657
version "6.23.0"
650658
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
651659
dependencies:
652660
babel-runtime "^6.22.0"
653661

654-
babel-plugin-transform-es2015-unicode-regex@^6.24.1:
662+
babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1:
655663
version "6.24.1"
656664
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
657665
dependencies:
658666
babel-helper-regex "^6.24.1"
659667
babel-runtime "^6.22.0"
660668
regexpu-core "^2.0.0"
661669

662-
babel-plugin-transform-exponentiation-operator@^6.24.1:
670+
babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1:
663671
version "6.24.1"
664672
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
665673
dependencies:
@@ -688,7 +696,7 @@ babel-plugin-transform-object-rest-spread@^6.22.0:
688696
babel-plugin-syntax-object-rest-spread "^6.8.0"
689697
babel-runtime "^6.26.0"
690698

691-
babel-plugin-transform-regenerator@^6.24.1:
699+
babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1:
692700
version "6.26.0"
693701
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
694702
dependencies:
@@ -701,6 +709,41 @@ babel-plugin-transform-strict-mode@^6.24.1:
701709
babel-runtime "^6.22.0"
702710
babel-types "^6.24.1"
703711

712+
713+
version "1.6.1"
714+
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48"
715+
dependencies:
716+
babel-plugin-check-es2015-constants "^6.22.0"
717+
babel-plugin-syntax-trailing-function-commas "^6.22.0"
718+
babel-plugin-transform-async-to-generator "^6.22.0"
719+
babel-plugin-transform-es2015-arrow-functions "^6.22.0"
720+
babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
721+
babel-plugin-transform-es2015-block-scoping "^6.23.0"
722+
babel-plugin-transform-es2015-classes "^6.23.0"
723+
babel-plugin-transform-es2015-computed-properties "^6.22.0"
724+
babel-plugin-transform-es2015-destructuring "^6.23.0"
725+
babel-plugin-transform-es2015-duplicate-keys "^6.22.0"
726+
babel-plugin-transform-es2015-for-of "^6.23.0"
727+
babel-plugin-transform-es2015-function-name "^6.22.0"
728+
babel-plugin-transform-es2015-literals "^6.22.0"
729+
babel-plugin-transform-es2015-modules-amd "^6.22.0"
730+
babel-plugin-transform-es2015-modules-commonjs "^6.23.0"
731+
babel-plugin-transform-es2015-modules-systemjs "^6.23.0"
732+
babel-plugin-transform-es2015-modules-umd "^6.23.0"
733+
babel-plugin-transform-es2015-object-super "^6.22.0"
734+
babel-plugin-transform-es2015-parameters "^6.23.0"
735+
babel-plugin-transform-es2015-shorthand-properties "^6.22.0"
736+
babel-plugin-transform-es2015-spread "^6.22.0"
737+
babel-plugin-transform-es2015-sticky-regex "^6.22.0"
738+
babel-plugin-transform-es2015-template-literals "^6.22.0"
739+
babel-plugin-transform-es2015-typeof-symbol "^6.23.0"
740+
babel-plugin-transform-es2015-unicode-regex "^6.22.0"
741+
babel-plugin-transform-exponentiation-operator "^6.22.0"
742+
babel-plugin-transform-regenerator "^6.22.0"
743+
browserslist "^2.1.2"
744+
invariant "^2.2.2"
745+
semver "^5.3.0"
746+
704747
babel-preset-es2015@^6.9.0:
705748
version "6.24.1"
706749
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
@@ -963,6 +1006,13 @@ browserify-zlib@^0.2.0:
9631006
dependencies:
9641007
pako "~1.0.5"
9651008

1009+
browserslist@^2.1.2:
1010+
version "2.11.3"
1011+
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2"
1012+
dependencies:
1013+
caniuse-lite "^1.0.30000792"
1014+
electron-to-chromium "^1.3.30"
1015+
9661016
buffer-xor@^1.0.3:
9671017
version "1.0.3"
9681018
resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9"
@@ -1035,6 +1085,10 @@ camelcase@^4.1.0:
10351085
version "4.1.0"
10361086
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
10371087

1088+
caniuse-lite@^1.0.30000792:
1089+
version "1.0.30000815"
1090+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000815.tgz#3a4258e6850362185adb11b0d754a48402d35bf6"
1091+
10381092
caseless@~0.11.0:
10391093
version "0.11.0"
10401094
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
@@ -1584,6 +1638,10 @@ ejs@^2.3.1:
15841638
version "2.5.7"
15851639
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a"
15861640

1641+
electron-to-chromium@^1.3.30:
1642+
version "1.3.39"
1643+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.39.tgz#d7a4696409ca0995e2750156da612c221afad84d"
1644+
15871645
elegant-spinner@^1.0.1:
15881646
version "1.0.1"
15891647
resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e"
@@ -2931,7 +2989,7 @@ loader-runner@^2.3.0:
29312989
version "2.3.0"
29322990
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
29332991

2934-
loader-utils@^1.1.0:
2992+
loader-utils@^1.0.2, loader-utils@^1.1.0:
29352993
version "1.1.0"
29362994
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
29372995
dependencies:

0 commit comments

Comments
 (0)