Skip to content

Commit

Permalink
rename webpack.full/quick to webpack.production/development
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Charytoniuk committed Apr 13, 2015
1 parent 650b54c commit a4a8724
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions gore-gulp/__tests__/setup/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ describe("setup", function () {
});

it("sets up gulp instance using development settings", function () {
doTestSetup("development", "webpack.quick");
doTestSetup("development", "webpack.development");
});

it("sets up gulp instance using production settings", function () {
doTestSetup("production", "webpack.full");
doTestSetup("production", "webpack.production");
});
});
2 changes: 1 addition & 1 deletion gore-gulp/__tests__/webpack/full.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("webpack", function () {

return gg(baseDir)
.webpack
.full(gulp, function (pckg) {
.production(gulp, function (pckg) {
distDir = path.join(tmpDir, pckg.directories.dist);

return _.merge(pckg, {
Expand Down
12 changes: 6 additions & 6 deletions gore-gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function setup(options, pckgPromise, gulp, self) {
var defaultWebpackVariant;

if ("production" === process.env.NODE_ENV) {
defaultWebpackVariant = "webpack.full";
defaultWebpackVariant = "webpack.production";
} else {
defaultWebpackVariant = "webpack.quick";
defaultWebpackVariant = "webpack.development";
}

gulp.task("default", [
Expand All @@ -33,8 +33,8 @@ function setup(options, pckgPromise, gulp, self) {
gulp.task("webpack", [
defaultWebpackVariant
]);
gulp.task("webpack.full", self.webpack.full());
gulp.task("webpack.quick", self.webpack.quick());
gulp.task("webpack.development", self.webpack.development());
gulp.task("webpack.production", self.webpack.production());
}

function setupTask(baseDir, pckgPromise, task) {
Expand Down Expand Up @@ -62,8 +62,8 @@ module.exports = function (baseDir) {
},
"test": setupTask(baseDir, pckgPromise, test),
"webpack": {
"full": setupTask(baseDir, pckgPromise, webpack.full),
"quick": setupTask(baseDir, pckgPromise, webpack.quick)
"development": setupTask(baseDir, pckgPromise, webpack.development),
"production": setupTask(baseDir, pckgPromise, webpack.production)
}
};
};
Expand Down
22 changes: 11 additions & 11 deletions gore-gulp/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ var path = require("path"),
slug = require("slug"),
webpack = require("webpack");

function full(config) {
function development(config) {
return _.assign(config, {
"debug": false,
"debug": true,
"plugins": [
new webpack.optimize.CommonsChunkPlugin(config.pckg.name + ".common.min.js"),
new webpack.optimize.UglifyJsPlugin()
new webpack.optimize.CommonsChunkPlugin(config.pckg.name + ".common.min.js")
]
});
}
Expand Down Expand Up @@ -66,11 +65,12 @@ function normalizeEntry(baseDir, pckg, entry, fileExtensions) {
return entry;
}

function quick(config) {
function production(config) {
return _.assign(config, {
"debug": true,
"debug": false,
"plugins": [
new webpack.optimize.CommonsChunkPlugin(config.pckg.name + ".common.min.js")
new webpack.optimize.CommonsChunkPlugin(config.pckg.name + ".common.min.js"),
new webpack.optimize.UglifyJsPlugin()
]
});
}
Expand Down Expand Up @@ -148,14 +148,14 @@ function stub(baseDir, pckgPromise) {
}

module.exports = {
"full": function (baseDir, pckgPromise) {
"development": function (baseDir, pckgPromise) {
return function () {
return stub(baseDir, pckgPromise).then(full).then(run);
return stub(baseDir, pckgPromise).then(development).then(run);
};
},
"quick": function (baseDir, pckgPromise) {
"production": function (baseDir, pckgPromise) {
return function () {
return stub(baseDir, pckgPromise).then(quick).then(run);
return stub(baseDir, pckgPromise).then(production).then(run);
};
}
};

0 comments on commit a4a8724

Please sign in to comment.