From 282f2f9fd0defd662c46790c2cb225b11c4c03c7 Mon Sep 17 00:00:00 2001 From: "cristian.jora" Date: Mon, 13 Feb 2017 22:47:24 +0200 Subject: [PATCH] #112 Get rid of moment over date-fns Use babel-plugin-lodash to support "tree-shaking" for lodash --- .babelrc | 2 +- package.json | 4 +++- src/fields/fieldDateTimePicker.vue | 19 +++++++++-------- src/fields/fieldInput.vue | 8 +++---- src/fields/fieldPikaday.vue | 16 +++++++------- src/utils/validators.js | 21 +++++++++---------- .../specs/fields/fieldDateTimePicker.spec.js | 3 ++- 7 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.babelrc b/.babelrc index f1c00cea..1ed6762e 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { "presets": ["es2015", "stage-2"], - "plugins": ["transform-runtime"], + "plugins": ["transform-runtime","lodash"], "comments": false } \ No newline at end of file diff --git a/package.json b/package.json index 71ac2037..1963f9fa 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "dist/vue-form-generator.js", "scripts": { "prebuild": "npm run test", - "build": "webpack --progress --config webpack.build.config.js", + "build": "webpack -p --progress --config webpack.build.config.js", "dev": "webpack-dev-server --config webpack.dev.config.js --inline --hot --content-base dev/", "lint": "eslint --ext=.js,.vue src test/unit/specs", "coverall": "cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", @@ -41,6 +41,7 @@ "devDependencies": { "babel-core": "6.22.1", "babel-loader": "6.2.10", + "babel-plugin-lodash": "^3.2.11", "babel-plugin-transform-runtime": "6.22.0", "babel-preset-es2015": "6.22.0", "babel-preset-stage-2": "6.22.0", @@ -49,6 +50,7 @@ "conventional-github-releaser": "1.1.3", "coveralls": "2.11.15", "css-loader": "0.26.1", + "date-fns": "^1.27.2", "eslint": "3.14.1", "eslint-friendly-formatter": "2.0.7", "eslint-loader": "1.6.1", diff --git a/src/fields/fieldDateTimePicker.vue b/src/fields/fieldDateTimePicker.vue index 349be8e8..3b9f895f 100644 --- a/src/fields/fieldDateTimePicker.vue +++ b/src/fields/fieldDateTimePicker.vue @@ -8,7 +8,8 @@ diff --git a/src/fields/fieldInput.vue b/src/fields/fieldInput.vue index 717f4de6..659846ee 100644 --- a/src/fields/fieldInput.vue +++ b/src/fields/fieldInput.vue @@ -37,7 +37,7 @@