From 93ddbbfa45a3d72d2de8a16961647801ed2cc2a9 Mon Sep 17 00:00:00 2001 From: dmbch Date: Sat, 3 Feb 2018 23:41:25 +0100 Subject: [PATCH] refactor(build-config): get rid of obsolete json loader --- packages/build-config/package.json | 8 +----- .../build-config/sections/module-rules.js | 25 +++++++++++-------- .../sections/module-rules/json.js | 8 ------ yarn.lock | 2 +- 4 files changed, 16 insertions(+), 27 deletions(-) delete mode 100644 packages/build-config/sections/module-rules/json.js diff --git a/packages/build-config/package.json b/packages/build-config/package.json index 93a66916e..1288ec3f9 100644 --- a/packages/build-config/package.json +++ b/packages/build-config/package.json @@ -2,12 +2,7 @@ "name": "hops-build-config", "version": "10.0.2", "description": "Hops build configuration leveraging Webpack and Babel", - "keywords": [ - "hops", - "webpack", - "babel", - "postcss" - ], + "keywords": ["hops", "webpack", "babel", "postcss"], "license": "MIT", "main": "index.js", "files": [ @@ -41,7 +36,6 @@ "file-loader": "^1.1.6", "find-up": "^2.1.0", "hops-config": "10.0.2", - "json-loader": "^0.5.7", "loader-utils": "^1.1.0", "lodash.template": "^4.4.0", "mkdirp": "^0.5.1", diff --git a/packages/build-config/sections/module-rules.js b/packages/build-config/sections/module-rules.js index 8385217a4..16cdad294 100644 --- a/packages/build-config/sections/module-rules.js +++ b/packages/build-config/sections/module-rules.js @@ -2,15 +2,18 @@ module.exports = function getModuleRules(target) { return [ - require('./module-rules/babel'), - require('./module-rules/graphql'), - require('./module-rules/postcss'), - require('./module-rules/json'), - require('./module-rules/file'), - require('./module-rules/url'), - require('./module-rules/tpl'), - require('./module-rules/config'), - ].map(function(config) { - return config[target] || config.default || config; - }); + { + oneOf: [ + require('./module-rules/babel'), + require('./module-rules/graphql'), + require('./module-rules/postcss'), + require('./module-rules/config'), + require('./module-rules/tpl'), + require('./module-rules/url'), + require('./module-rules/file'), + ].map(function(config) { + return config[target] || config.default || config; + }), + }, + ]; }; diff --git a/packages/build-config/sections/module-rules/json.js b/packages/build-config/sections/module-rules/json.js deleted file mode 100644 index e62484b9c..000000000 --- a/packages/build-config/sections/module-rules/json.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -exports.default = { - test: /\.json$/, - use: { - loader: require.resolve('json-loader'), - }, -}; diff --git a/yarn.lock b/yarn.lock index 75702c7dd..8a733a0c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4675,7 +4675,7 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" -json-loader@^0.5.4, json-loader@^0.5.7: +json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"