From dbeeb5a25084cadce51be119643527ce4c5f731b Mon Sep 17 00:00:00 2001 From: ZauberNerd Date: Wed, 20 Sep 2017 16:58:44 +0200 Subject: [PATCH] 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`. --- .../{config => build-config}/configs/build.js | 2 +- .../configs/develop.js | 2 +- .../{config => build-config}/configs/node.js | 2 +- packages/build-config/index.js | 29 +++++++++ .../lib/check-esnext.js | 0 .../loaders/config.js | 2 +- .../{config => build-config}/loaders/tpl.js | 0 packages/build-config/package.json | 63 +++++++++++++++++++ .../plugins/write-file.js | 2 +- .../plugins/write-manifest.js | 2 +- packages/build-config/readme.md | 11 ++++ .../sections/dev-server-https.js | 2 +- .../sections/module-rules.js | 0 .../sections/module-rules/babel.js | 2 +- .../sections/module-rules/config.js | 0 .../sections/module-rules/file.js | 2 +- .../sections/module-rules/json.js | 0 .../sections/module-rules/postcss.js | 2 +- .../sections/module-rules/tpl.js | 0 .../sections/module-rules/url.js | 2 +- .../sections/resolve.js | 2 +- .../{config => build-config}/shims/build.js | 0 .../{config => build-config}/shims/develop.js | 0 .../{config => build-config}/shims/node.js | 0 .../shims/package.json | 0 .../ssl/localhost.ssl.crt | 0 .../ssl/localhost.ssl.key | 0 .../{config => build-config}/ssl/rootca.pem | 0 packages/build/build.js | 5 +- packages/build/package.json | 1 + packages/build/server.js | 5 +- packages/config/index.js | 3 - packages/config/package.json | 30 +-------- packages/express/app.js | 3 +- packages/express/package.json | 1 + packages/jest-preset/package.json | 4 +- packages/jest-preset/transform.js | 2 +- spec/mock/webpack.bad-export.js | 2 +- spec/mock/webpack.bad-handler.js | 2 +- spec/mock/webpack.good.js | 2 +- 40 files changed, 133 insertions(+), 54 deletions(-) rename packages/{config => build-config}/configs/build.js (97%) rename packages/{config => build-config}/configs/develop.js (97%) rename packages/{config => build-config}/configs/node.js (96%) create mode 100644 packages/build-config/index.js rename packages/{config => build-config}/lib/check-esnext.js (100%) rename packages/{config => build-config}/loaders/config.js (81%) rename packages/{config => build-config}/loaders/tpl.js (100%) create mode 100644 packages/build-config/package.json rename packages/{config => build-config}/plugins/write-file.js (95%) rename packages/{config => build-config}/plugins/write-manifest.js (96%) create mode 100644 packages/build-config/readme.md rename packages/{config => build-config}/sections/dev-server-https.js (91%) rename packages/{config => build-config}/sections/module-rules.js (100%) rename packages/{config => build-config}/sections/module-rules/babel.js (96%) rename packages/{config => build-config}/sections/module-rules/config.js (100%) rename packages/{config => build-config}/sections/module-rules/file.js (86%) rename packages/{config => build-config}/sections/module-rules/json.js (100%) rename packages/{config => build-config}/sections/module-rules/postcss.js (96%) rename packages/{config => build-config}/sections/module-rules/tpl.js (100%) rename packages/{config => build-config}/sections/module-rules/url.js (86%) rename packages/{config => build-config}/sections/resolve.js (92%) rename packages/{config => build-config}/shims/build.js (100%) rename packages/{config => build-config}/shims/develop.js (100%) rename packages/{config => build-config}/shims/node.js (100%) rename packages/{config => build-config}/shims/package.json (100%) rename packages/{config => build-config}/ssl/localhost.ssl.crt (100%) rename packages/{config => build-config}/ssl/localhost.ssl.key (100%) rename packages/{config => build-config}/ssl/rootca.pem (100%) diff --git a/packages/config/configs/build.js b/packages/build-config/configs/build.js similarity index 97% rename from packages/config/configs/build.js rename to packages/build-config/configs/build.js index acf7ee092..5c7d47879 100644 --- a/packages/config/configs/build.js +++ b/packages/build-config/configs/build.js @@ -9,7 +9,7 @@ var MinifyPlugin = require('babel-minify-webpack-plugin'); var WriteManifestPlugin = require('../plugins/write-manifest'); var WriteFilePlugin = require('../plugins/write-file'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); var getAssetPath = path.join.bind(path, hopsConfig.assetPath); diff --git a/packages/config/configs/develop.js b/packages/build-config/configs/develop.js similarity index 97% rename from packages/config/configs/develop.js rename to packages/build-config/configs/develop.js index efdaa96d3..dd3d0d3c1 100644 --- a/packages/config/configs/develop.js +++ b/packages/build-config/configs/develop.js @@ -7,7 +7,7 @@ var webpack = require('webpack'); var WriteManifestPlugin = require('../plugins/write-manifest'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); var getAssetPath = path.join.bind(path, hopsConfig.assetPath); diff --git a/packages/config/configs/node.js b/packages/build-config/configs/node.js similarity index 96% rename from packages/config/configs/node.js rename to packages/build-config/configs/node.js index 432e56f15..772bd9a32 100644 --- a/packages/config/configs/node.js +++ b/packages/build-config/configs/node.js @@ -3,7 +3,7 @@ var path = require('path'); var webpack = require('webpack'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); var hopsConfigInstallDir = path.dirname(require.resolve('hops-config')); var modulesDir = path.resolve(hopsConfigInstallDir, '..'); diff --git a/packages/build-config/index.js b/packages/build-config/index.js new file mode 100644 index 000000000..9d8ecedef --- /dev/null +++ b/packages/build-config/index.js @@ -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') +}); diff --git a/packages/config/lib/check-esnext.js b/packages/build-config/lib/check-esnext.js similarity index 100% rename from packages/config/lib/check-esnext.js rename to packages/build-config/lib/check-esnext.js diff --git a/packages/config/loaders/config.js b/packages/build-config/loaders/config.js similarity index 81% rename from packages/config/loaders/config.js rename to packages/build-config/loaders/config.js index ead14f7da..4f06d24ea 100644 --- a/packages/config/loaders/config.js +++ b/packages/build-config/loaders/config.js @@ -1,6 +1,6 @@ 'use strict'; -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); module.exports = function () { this.cacheable(); diff --git a/packages/config/loaders/tpl.js b/packages/build-config/loaders/tpl.js similarity index 100% rename from packages/config/loaders/tpl.js rename to packages/build-config/loaders/tpl.js diff --git a/packages/build-config/package.json b/packages/build-config/package.json new file mode 100644 index 000000000..0bbc4e115 --- /dev/null +++ b/packages/build-config/package.json @@ -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" + } +} diff --git a/packages/config/plugins/write-file.js b/packages/build-config/plugins/write-file.js similarity index 95% rename from packages/config/plugins/write-file.js rename to packages/build-config/plugins/write-file.js index f1c70b535..02c60ddaa 100644 --- a/packages/config/plugins/write-file.js +++ b/packages/build-config/plugins/write-file.js @@ -4,7 +4,7 @@ var fs = require('fs'); var path = require('path'); var mkdirp = require('mkdirp'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); module.exports = function Plugin (regExp) { this.apply = function (compiler) { diff --git a/packages/config/plugins/write-manifest.js b/packages/build-config/plugins/write-manifest.js similarity index 96% rename from packages/config/plugins/write-manifest.js rename to packages/build-config/plugins/write-manifest.js index 8e0f8ce91..f2ed52622 100644 --- a/packages/config/plugins/write-manifest.js +++ b/packages/build-config/plugins/write-manifest.js @@ -4,7 +4,7 @@ var fs = require('fs'); var path = require('path'); var mkdirp = require('mkdirp'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); module.exports = function Plugin (regExp) { this.apply = function (compiler) { diff --git a/packages/build-config/readme.md b/packages/build-config/readme.md new file mode 100644 index 000000000..68a2ecc80 --- /dev/null +++ b/packages/build-config/readme.md @@ -0,0 +1,11 @@ + +# Hops Build Config + + + +### Target Audience + + + +### Example + diff --git a/packages/config/sections/dev-server-https.js b/packages/build-config/sections/dev-server-https.js similarity index 91% rename from packages/config/sections/dev-server-https.js rename to packages/build-config/sections/dev-server-https.js index 7fdfd60a1..19f1ed958 100644 --- a/packages/config/sections/dev-server-https.js +++ b/packages/build-config/sections/dev-server-https.js @@ -3,7 +3,7 @@ var fs = require('fs'); var path = require('path'); -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); function readSSLFile (fileName) { var filePath = path.resolve(__dirname, '..', 'ssl', fileName); diff --git a/packages/config/sections/module-rules.js b/packages/build-config/sections/module-rules.js similarity index 100% rename from packages/config/sections/module-rules.js rename to packages/build-config/sections/module-rules.js diff --git a/packages/config/sections/module-rules/babel.js b/packages/build-config/sections/module-rules/babel.js similarity index 96% rename from packages/config/sections/module-rules/babel.js rename to packages/build-config/sections/module-rules/babel.js index 2b7e149d8..dafe7443e 100644 --- a/packages/config/sections/module-rules/babel.js +++ b/packages/build-config/sections/module-rules/babel.js @@ -1,6 +1,6 @@ 'use strict'; -var hopsConfig = require('../..'); +var hopsConfig = require('hops-config'); function createIdentifier (targets) { return JSON.stringify({ diff --git a/packages/config/sections/module-rules/config.js b/packages/build-config/sections/module-rules/config.js similarity index 100% rename from packages/config/sections/module-rules/config.js rename to packages/build-config/sections/module-rules/config.js diff --git a/packages/config/sections/module-rules/file.js b/packages/build-config/sections/module-rules/file.js similarity index 86% rename from packages/config/sections/module-rules/file.js rename to packages/build-config/sections/module-rules/file.js index 3ce850608..88cc9bc40 100644 --- a/packages/config/sections/module-rules/file.js +++ b/packages/build-config/sections/module-rules/file.js @@ -2,7 +2,7 @@ var path = require('path'); -var hopsConfig = require('../..'); +var hopsConfig = require('hops-config'); exports.default = { test: /\.(html|svg|((o|t)tf)|woff2?|ico)$/, diff --git a/packages/config/sections/module-rules/json.js b/packages/build-config/sections/module-rules/json.js similarity index 100% rename from packages/config/sections/module-rules/json.js rename to packages/build-config/sections/module-rules/json.js diff --git a/packages/config/sections/module-rules/postcss.js b/packages/build-config/sections/module-rules/postcss.js similarity index 96% rename from packages/config/sections/module-rules/postcss.js rename to packages/build-config/sections/module-rules/postcss.js index ffdc2e66b..864ba394d 100644 --- a/packages/config/sections/module-rules/postcss.js +++ b/packages/build-config/sections/module-rules/postcss.js @@ -2,7 +2,7 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var hopsConfig = require('../..'); +var hopsConfig = require('hops-config'); var cssLoaderOptions = { importLoaders: 1, diff --git a/packages/config/sections/module-rules/tpl.js b/packages/build-config/sections/module-rules/tpl.js similarity index 100% rename from packages/config/sections/module-rules/tpl.js rename to packages/build-config/sections/module-rules/tpl.js diff --git a/packages/config/sections/module-rules/url.js b/packages/build-config/sections/module-rules/url.js similarity index 86% rename from packages/config/sections/module-rules/url.js rename to packages/build-config/sections/module-rules/url.js index 36f5ef8aa..9d740eaba 100644 --- a/packages/config/sections/module-rules/url.js +++ b/packages/build-config/sections/module-rules/url.js @@ -2,7 +2,7 @@ var path = require('path'); -var hopsConfig = require('../..'); +var hopsConfig = require('hops-config'); exports.default = { test: /\.(png|gif|jpe?g|webp)$/, diff --git a/packages/config/sections/resolve.js b/packages/build-config/sections/resolve.js similarity index 92% rename from packages/config/sections/resolve.js rename to packages/build-config/sections/resolve.js index db878b92e..c09438055 100644 --- a/packages/config/sections/resolve.js +++ b/packages/build-config/sections/resolve.js @@ -1,6 +1,6 @@ 'use strict'; -var hopsConfig = require('..'); +var hopsConfig = require('hops-config'); module.exports = function getResolveConfig (target) { var platform = (target === 'node') ? 'server' : 'browser'; diff --git a/packages/config/shims/build.js b/packages/build-config/shims/build.js similarity index 100% rename from packages/config/shims/build.js rename to packages/build-config/shims/build.js diff --git a/packages/config/shims/develop.js b/packages/build-config/shims/develop.js similarity index 100% rename from packages/config/shims/develop.js rename to packages/build-config/shims/develop.js diff --git a/packages/config/shims/node.js b/packages/build-config/shims/node.js similarity index 100% rename from packages/config/shims/node.js rename to packages/build-config/shims/node.js diff --git a/packages/config/shims/package.json b/packages/build-config/shims/package.json similarity index 100% rename from packages/config/shims/package.json rename to packages/build-config/shims/package.json diff --git a/packages/config/ssl/localhost.ssl.crt b/packages/build-config/ssl/localhost.ssl.crt similarity index 100% rename from packages/config/ssl/localhost.ssl.crt rename to packages/build-config/ssl/localhost.ssl.crt diff --git a/packages/config/ssl/localhost.ssl.key b/packages/build-config/ssl/localhost.ssl.key similarity index 100% rename from packages/config/ssl/localhost.ssl.key rename to packages/build-config/ssl/localhost.ssl.key diff --git a/packages/config/ssl/rootca.pem b/packages/build-config/ssl/rootca.pem similarity index 100% rename from packages/config/ssl/rootca.pem rename to packages/build-config/ssl/rootca.pem diff --git a/packages/build/build.js b/packages/build/build.js index 45bd36cc7..19c754691 100644 --- a/packages/build/build.js +++ b/packages/build/build.js @@ -4,10 +4,11 @@ var webpack = require('webpack'); var merge = require('webpack-merge'); var hopsConfig = require('hops-config'); +var hopsBuildConfig = require('hops-build-config'); var HopsPlugin = require('hops-plugin'); -var buildConfig = require(hopsConfig.buildConfig); -var nodeConfig = require(hopsConfig.nodeConfig); +var buildConfig = require(hopsBuildConfig.buildConfig); +var nodeConfig = require(hopsBuildConfig.nodeConfig); var cleanup = require('./lib/cleanup'); diff --git a/packages/build/package.json b/packages/build/package.json index 1e6f1553a..d37b6d336 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -20,6 +20,7 @@ "url": "https://github.com/xing/hops.git" }, "dependencies": { + "hops-build-config": "6.2.8", "hops-middleware": "6.2.8", "hops-plugin": "6.2.8", "hops-server": "6.2.8", diff --git a/packages/build/server.js b/packages/build/server.js index 1248740c7..812657880 100644 --- a/packages/build/server.js +++ b/packages/build/server.js @@ -4,6 +4,7 @@ var webpack = require('webpack'); var WebpackServer = require('webpack-dev-server'); var hopsConfig = require('hops-config'); +var hopsBuildConfig = require('hops-build-config'); var createMiddleware = require('hops-middleware'); var server = require('hops-server'); @@ -14,7 +15,7 @@ process.on('unhandledRejection', function (error) { }); function runDevelop (options, callback) { - var config = require(hopsConfig.developConfig); + var config = require(hopsBuildConfig.developConfig); var watchOptions = config.devServer.watchOptions || config.watchOptions; var app = new WebpackServer( webpack(config), @@ -23,7 +24,7 @@ function runDevelop (options, callback) { app.use(server.rewritePath); server.bootstrap(app, hopsConfig); server.registerMiddleware(app, createMiddleware( - require(hopsConfig.nodeConfig), + require(hopsBuildConfig.nodeConfig), watchOptions )); server.teardown(app, hopsConfig); diff --git a/packages/config/index.js b/packages/config/index.js index 9493d89f4..12e1c6b57 100644 --- a/packages/config/index.js +++ b/packages/config/index.js @@ -88,9 +88,6 @@ module.exports = freeze( appDir: '.', buildDir: 'build', cacheDir: 'node_modules/.cache/hops', - buildConfig: require.resolve('./configs/build'), - developConfig: require.resolve('./configs/develop'), - nodeConfig: require.resolve('./configs/node'), manifest: manifestUtil.getManifest, assets: manifestUtil.getAssets }) diff --git a/packages/config/package.json b/packages/config/package.json index 7771d2211..92d2fab3c 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -29,32 +29,6 @@ "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" + "pkg-dir": "^2.0.0" } -} \ No newline at end of file +} diff --git a/packages/express/app.js b/packages/express/app.js index 56a6a8a12..499689313 100644 --- a/packages/express/app.js +++ b/packages/express/app.js @@ -8,7 +8,8 @@ var mime = require('mime'); var helmet = require('helmet'); var hopsConfig = require('hops-config'); -var webpackConfig = require(hopsConfig.nodeConfig); +var hopsBuildConfig = require('hops-build-config'); +var webpackConfig = require(hopsBuildConfig.nodeConfig); var server = require('hops-server'); diff --git a/packages/express/package.json b/packages/express/package.json index d579601dd..96729e227 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -22,6 +22,7 @@ "dependencies": { "express": "^4.16.0", "helmet": "^3.8.2", + "hops-build-config": "6.2.8", "hops-server": "6.2.8", "mime": "^2.0.3" }, diff --git a/packages/jest-preset/package.json b/packages/jest-preset/package.json index aecfa0577..9e103add2 100644 --- a/packages/jest-preset/package.json +++ b/packages/jest-preset/package.json @@ -26,7 +26,7 @@ "identity-obj-proxy": "^3.0.0" }, "peerDependencies": { - "hops-config": "6.2.8", + "hops-build-config": "6.2.8", "jest": "21" } -} \ No newline at end of file +} diff --git a/packages/jest-preset/transform.js b/packages/jest-preset/transform.js index 2dd663fc3..540a27434 100644 --- a/packages/jest-preset/transform.js +++ b/packages/jest-preset/transform.js @@ -1,6 +1,6 @@ var babelJest = require('babel-jest'); -var loaderConfig = require('hops-config/sections/module-rules/babel').node; +var loaderConfig = require('hops-build-config/sections/module-rules/babel').node; var babelConfig = loaderConfig.use.options; diff --git a/spec/mock/webpack.bad-export.js b/spec/mock/webpack.bad-export.js index a025f318d..f6e284680 100644 --- a/spec/mock/webpack.bad-export.js +++ b/spec/mock/webpack.bad-export.js @@ -2,7 +2,7 @@ var path = require('path'); -var defaultConfig = require('hops-config/configs/node'); +var defaultConfig = require('hops-build-config/configs/node'); var projectDir = path.resolve(__dirname, 'bad-export'); diff --git a/spec/mock/webpack.bad-handler.js b/spec/mock/webpack.bad-handler.js index 11486683b..5354f0d47 100644 --- a/spec/mock/webpack.bad-handler.js +++ b/spec/mock/webpack.bad-handler.js @@ -2,7 +2,7 @@ var path = require('path'); -var defaultConfig = require('hops-config/configs/node'); +var defaultConfig = require('hops-build-config/configs/node'); var projectDir = path.resolve(__dirname, 'bad-handler'); diff --git a/spec/mock/webpack.good.js b/spec/mock/webpack.good.js index 4b2d5d3d6..e5ed1263f 100644 --- a/spec/mock/webpack.good.js +++ b/spec/mock/webpack.good.js @@ -2,7 +2,7 @@ var path = require('path'); -var defaultConfig = require('hops-config/configs/node'); +var defaultConfig = require('hops-build-config/configs/node'); var projectDir = path.resolve(__dirname, 'good');