From 469db7eb9d4a99236fc6e46a9b5ddcac026a99cc Mon Sep 17 00:00:00 2001
From: Pettarn <1225076678@qq.com>
Date: Fri, 29 Mar 2019 18:46:38 +0800
Subject: [PATCH] update Edition
---
.babelrc | 8 -
.eslintrc.json | 30 -
.gitignore | 1 +
babel.config.js | 15 +
dist/webpack-numbers.js | 2 +-
examples/browser/index.html | 2 +-
examples/browser/webpack-numbers.js | 2 +-
examples/node/example.js | 2 +-
examples/node/webpack-numbers.js | 2 +-
index.js | 6 +-
package.json | 22 +-
webpack.config.babel.js | 33 -
webpack.config.js | 32 +
yarn.lock | 4152 +++++++++------------------
14 files changed, 1462 insertions(+), 2847 deletions(-)
delete mode 100644 .babelrc
delete mode 100644 .eslintrc.json
create mode 100644 babel.config.js
delete mode 100644 webpack.config.babel.js
create mode 100644 webpack.config.js
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index edfabf8..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "presets": [
- "env"
- ],
- "plugins": [
- "add-module-exports"
- ]
-}
\ No newline at end of file
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index b6671b8..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "env": {
- "browser": true,
- "commonjs": true,
- "es6": true,
- "node": true
- },
- "extends": "eslint:recommended",
- "parserOptions": {
- "sourceType": "module"
- },
- "rules": {
- "indent": [
- "error",
- 4
- ],
- "linebreak-style": [
- "error",
- "unix"
- ],
- "quotes": [
- "error",
- "single"
- ],
- "semi": [
- "error",
- "always"
- ]
- }
-}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 944c283..335981c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
node_modules
.idea/
+yarn-error.log
\ No newline at end of file
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 0000000..32066da
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,15 @@
+const presets = [
+ [
+ "@babel/preset-env",
+ {
+ "targets": {
+ "browsers": "last 2 versions, > 1%, ie >= 6, Chrome >= 29, Firefox >= 55, Safari >= 9, Android >= 4, iOS >= 9, and_uc > 11",
+ "node": "current"
+ },
+ },
+ ],
+];
+const plugins = [
+ "@babel/plugin-transform-runtime",
+]
+module.exports = { presets, plugins };
\ No newline at end of file
diff --git a/dist/webpack-numbers.js b/dist/webpack-numbers.js
index c59c645..cd22938 100644
--- a/dist/webpack-numbers.js
+++ b/dist/webpack-numbers.js
@@ -1 +1 @@
-!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],r):"object"==typeof exports?exports.webpackNumbers=r(require("lodash")):e.webpackNumbers=r(e._)}(this,function(e){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=2)}([function(e){e.exports=[{num:1,word:"One"},{num:2,word:"Two"},{num:3,word:"Three"},{num:4,word:"Four"},{num:5,word:"Five"},{num:0,word:"Zero"}]},function(r,t){r.exports=e},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=u(t(1)),o=u(t(0));function u(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return n.default.reduce(o.default,function(r,t){return t.num===e?t.word:r},"")},i=function(e){return n.default.reduce(o.default,function(r,t){return t.word===e&&e.toLowerCase()?t.num:r},-1)};r.default={numtoword:function(e){return e<0||e>5?"This is a failure":f(e)},wordtonum:function(e){var r=i(e);return-1===r?"This is a failure":r}},e.exports=r.default}])});
\ No newline at end of file
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],r):"object"==typeof exports?exports.webpackNumbers=r(require("lodash")):e.webpackNumbers=r(e._)}(this,function(e){return function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=2)}([function(r,n){r.exports=e},function(e){e.exports=[{num:1,word:"One"},{num:2,word:"Two"},{num:3,word:"Three"},{num:4,word:"Four"},{num:5,word:"Five"},{num:0,word:"Zero"}]},function(e,r,n){"use strict";n.r(r),n.d(r,"createTranslator",function(){return i});var t=n(0),o=n.n(t),u=n(1);function i(){return{numtoword:function(e){return e<0||e>5?"This is a failure":f(e)},wordtonum:function(e){var r=c(e);return-1===r?"This is a failure":r}}}var f=function(e){return o.a.reduce(u,function(r,n){return n.num===e?n.word:r},"")},c=function(e){return o.a.reduce(u,function(r,n){return n.word===e&&e.toLowerCase()?n.num:r},-1)}}])});
\ No newline at end of file
diff --git a/examples/browser/index.html b/examples/browser/index.html
index 454ecee..4dbcf4b 100644
--- a/examples/browser/index.html
+++ b/examples/browser/index.html
@@ -8,7 +8,7 @@