-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(config): extract webpack/build config into hops-build-config
Move all build-relevant config into a new package "hops-build-config", to free "hops-config" from all dependencies that are only relevant for building code (webpack, babel, postcss, etc). Now hops-config only contains the base configuration of paths etc and hops-build-config contains all devDependencies. THIS IS A BREAKING CHANGE: `buildConfig`, `developConfig` and `nodeConfig` have been removed from `hops-config`. They are now accessible on the `hops-build-config` export. Also: All deep-requires into `hops-config/{configs,lib/check-esnext, loaders,plugins,sections,shims,ssl}` must now use `hops-build-config`.
- Loading branch information
1 parent
f7a245f
commit dbeeb5a
Showing
40 changed files
with
133 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
var hopsConfig = require('hops-config'); | ||
|
||
function freeze (config) { | ||
return Object.freeze( | ||
Object.keys(config).reduce(function (result, key) { | ||
var descriptor = { enumerable: true }; | ||
if (typeof config[key] === 'function') { | ||
descriptor.get = config[key]; | ||
} else { | ||
descriptor.value = config[key]; | ||
} | ||
return Object.defineProperty(result, key, descriptor); | ||
}, {}) | ||
); | ||
} | ||
|
||
module.exports = freeze({ | ||
buildConfig: hopsConfig.buildConfig | ||
? hopsConfig.buildConfig | ||
: require.resolve('./configs/build'), | ||
developConfig: hopsConfig.developConfig | ||
? hopsConfig.developConfig | ||
: require.resolve('./configs/develop'), | ||
nodeConfig: hopsConfig.nodeConfig | ||
? hopsConfig.nodeConfig | ||
: require.resolve('./configs/node') | ||
}); |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/config/loaders/config.js → packages/build-config/loaders/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "hops-build-config", | ||
"version": "6.2.8", | ||
"description": "Hops core configuration leveraging Webpack and Babel", | ||
"keywords": [ | ||
"hops", | ||
"webpack", | ||
"babel", | ||
"postcss" | ||
], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js", | ||
"manifest.js", | ||
"configs", | ||
"lib", | ||
"loaders", | ||
"plugins", | ||
"sections", | ||
"shims", | ||
"ssl" | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: run tests in xing/hops repo\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/xing/hops.git" | ||
}, | ||
"dependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-minify-webpack-plugin": "0.2.0", | ||
"babel-plugin-dynamic-import-node": "^1.1.0", | ||
"babel-plugin-flow-react-proptypes": "^5.2.0", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.6.0", | ||
"babel-preset-react": "^6.24.1", | ||
"css-loader": "^0.28.7", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"file-loader": "^0.11.2", | ||
"json-loader": "^0.5.7", | ||
"lodash.template": "^4.4.0", | ||
"mkdirp": "^0.5.1", | ||
"pkg-dir": "^2.0.0", | ||
"postcss": "^6.0.12", | ||
"postcss-cssnext": "^3.0.2", | ||
"postcss-import": "^11.0.0", | ||
"postcss-loader": "^2.0.6", | ||
"style-loader": "^0.18.2", | ||
"url-loader": "^0.5.9", | ||
"webpack": "^3.6.0", | ||
"webpack-dev-server": "^2.9.1", | ||
"webpack-node-externals": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"hops-config": "6.2.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# Hops Build Config | ||
|
||
|
||
|
||
### Target Audience | ||
|
||
|
||
|
||
### Example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ges/config/sections/module-rules/babel.js → ...ild-config/sections/module-rules/babel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/config/sections/resolve.js → packages/build-config/sections/resolve.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters