From c6951bbec0db695e1151c9c5720f96396a146284 Mon Sep 17 00:00:00 2001 From: Guilherme Rv Coelho Date: Thu, 12 Apr 2018 07:32:48 -0300 Subject: [PATCH] chore: add babel configuration --- .babelrc | 7 ++++++ package-lock.json | 62 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +++ webpack.config.js | 9 +++++++ 4 files changed, 81 insertions(+) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..9d0e030 --- /dev/null +++ b/.babelrc @@ -0,0 +1,7 @@ +{ + "presets": ["es2015"], + "plugins": [ + "add-module-exports", + "ramda" + ] +} diff --git a/package-lock.json b/package-lock.json index fb7367e..50c1e19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,35 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/helper-module-imports": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.44.tgz", + "integrity": "sha512-V95wi6rCffcLM46XdaUJHRc3D/XSvfsQshedaX1riHQCbs0uVopdswXrykwB6E/QEPfUGxXfs7l5GubupOi+Cw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44", + "lodash": "4.17.5" + } + }, + "@babel/types": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", + "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", + "dev": true, + "requires": { + "esutils": "2.0.2", + "lodash": "4.17.5", + "to-fast-properties": "2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, "@sindresorhus/is": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", @@ -459,6 +488,17 @@ "babel-template": "6.26.0" } }, + "babel-loader": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", + "integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", + "dev": true, + "requires": { + "find-cache-dir": "1.0.0", + "loader-utils": "1.1.0", + "mkdirp": "0.5.1" + } + }, "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", @@ -468,6 +508,12 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-add-module-exports": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", + "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=", + "dev": true + }, "babel-plugin-check-es2015-constants": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", @@ -477,6 +523,16 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-ramda": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-plugin-ramda/-/babel-plugin-ramda-1.6.1.tgz", + "integrity": "sha512-NgcivPSXuuRfWRupfyu/gt6UfBSf/hFm7wiMY5PwjKrRMv+J19BbDYAlLFGnRSm7P/8UkOxiuDQjuYhgFirdHg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.44", + "ramda": "0.25.0" + } + }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", @@ -5807,6 +5863,12 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "ramda": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", + "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==", + "dev": true + }, "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", diff --git a/package.json b/package.json index 92a5e7f..8ba2d4f 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,9 @@ }, "homepage": "https://github.com/grvcoelho/difflint#readme", "devDependencies": { + "babel-loader": "^7.1.4", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-ramda": "^1.6.1", "webpack": "^4.5.0", "webpack-cli": "^2.0.14" } diff --git a/webpack.config.js b/webpack.config.js index 311a48e..4631f71 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,15 @@ const config = { devtool: 'source-map', target: 'node', mode: 'production', + module: { + rules: [ + { + test: /\.js$/, + use: 'babel-loader', + exclude: /node_modules/, + }, + ], + }, } module.exports = config