Skip to content

Commit

Permalink
More options to enable production mode
Browse files Browse the repository at this point in the history
Removed browserlist which overrides per-project browserlist
  • Loading branch information
kasparsz committed Jul 13, 2020
1 parent 035a3e7 commit 868f567
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .browserslistrc

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.0] - 2020-07-13
### Removes
- .browserlistrc which was overriding per-project browser list
### Changed
- Any task with `-build` in the name will now trigger `production` mode
10 changes: 9 additions & 1 deletion gulpfile.js/index.js
Expand Up @@ -2,7 +2,15 @@ const getConfig = require('./../lib/get-config');
const generateGulpTasks = require('./../lib/generate-gulp-tasks');

// Set mode globally it can be used by tasks
const hasProductionArg = process.argv.indexOf('build') !== -1;
let hasProductionArg = false;

for (let i = 0; i < process.argv.length; i++) {
const argValue = process.argv[i];
// If build task is 'build' or '...-build' then set production mode
if (argValue === 'build' || argValue.indexOf('-build') !== -1) {
hasProductionArg = true;
}
}

global.production = global.production || (hasProductionArg || process.env.NODE_ENV === 'production');
global.development = !global.production;
Expand Down
7 changes: 6 additions & 1 deletion init/default/package.json
Expand Up @@ -7,5 +7,10 @@
},
"dependencies": {
"normalize-scss": "^7.0.0"
}
},
"browserslist": [
"defaults",
"not IE 11",
"not IE_Mob 11"
]
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@videinfra/static-website-builder",
"version": "1.1.0",
"version": "1.2.0",
"description": "Customizable static site project builder",
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 868f567

Please sign in to comment.