Skip to content

Commit 93ddbbf

Browse files
committed
refactor(build-config): get rid of obsolete json loader
1 parent 504e51d commit 93ddbbf

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

packages/build-config/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
"name": "hops-build-config",
33
"version": "10.0.2",
44
"description": "Hops build configuration leveraging Webpack and Babel",
5-
"keywords": [
6-
"hops",
7-
"webpack",
8-
"babel",
9-
"postcss"
10-
],
5+
"keywords": ["hops", "webpack", "babel", "postcss"],
116
"license": "MIT",
127
"main": "index.js",
138
"files": [
@@ -41,7 +36,6 @@
4136
"file-loader": "^1.1.6",
4237
"find-up": "^2.1.0",
4338
"hops-config": "10.0.2",
44-
"json-loader": "^0.5.7",
4539
"loader-utils": "^1.1.0",
4640
"lodash.template": "^4.4.0",
4741
"mkdirp": "^0.5.1",

packages/build-config/sections/module-rules.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
module.exports = function getModuleRules(target) {
44
return [
5-
require('./module-rules/babel'),
6-
require('./module-rules/graphql'),
7-
require('./module-rules/postcss'),
8-
require('./module-rules/json'),
9-
require('./module-rules/file'),
10-
require('./module-rules/url'),
11-
require('./module-rules/tpl'),
12-
require('./module-rules/config'),
13-
].map(function(config) {
14-
return config[target] || config.default || config;
15-
});
5+
{
6+
oneOf: [
7+
require('./module-rules/babel'),
8+
require('./module-rules/graphql'),
9+
require('./module-rules/postcss'),
10+
require('./module-rules/config'),
11+
require('./module-rules/tpl'),
12+
require('./module-rules/url'),
13+
require('./module-rules/file'),
14+
].map(function(config) {
15+
return config[target] || config.default || config;
16+
}),
17+
},
18+
];
1619
};

packages/build-config/sections/module-rules/json.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4675,7 +4675,7 @@ jsesc@~0.5.0:
46754675
version "0.5.0"
46764676
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
46774677

4678-
json-loader@^0.5.4, json-loader@^0.5.7:
4678+
json-loader@^0.5.4:
46794679
version "0.5.7"
46804680
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
46814681

0 commit comments

Comments
 (0)