don't compress for CI runs (#1949)

This commit is contained in:
Paulus Schoutsen 2018-11-02 12:15:45 +01:00 committed by GitHub
parent aebd1a1be1
commit eb505d4bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@ const config = require("./config.js");
const { babelLoaderConfig } = require("../config/babel.js"); const { babelLoaderConfig } = require("../config/babel.js");
const isProdBuild = process.env.NODE_ENV === "production"; const isProdBuild = process.env.NODE_ENV === "production";
const isCI = process.env.CI === "true";
const chunkFilename = isProdBuild ? "chunk.[chunkhash].js" : "[name].chunk.js"; const chunkFilename = isProdBuild ? "chunk.[chunkhash].js" : "[name].chunk.js";
module.exports = { module.exports = {
@ -37,6 +38,7 @@ module.exports = {
}, },
}), }),
isProdBuild && isProdBuild &&
isCI &&
new CompressionPlugin({ new CompressionPlugin({
cache: true, cache: true,
exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/], exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/],

View File

@ -15,6 +15,7 @@ if (!version) {
throw Error("Version not found"); throw Error("Version not found");
} }
const VERSION = version[0]; const VERSION = version[0];
const isCI = process.env.CI === "true";
const generateJSPage = (entrypoint, latestBuild) => { const generateJSPage = (entrypoint, latestBuild) => {
return new HtmlWebpackPlugin({ return new HtmlWebpackPlugin({
@ -159,6 +160,7 @@ function createConfig(isProdBuild, latestBuild) {
path.resolve(__dirname, "src/util/empty.js") path.resolve(__dirname, "src/util/empty.js")
), ),
isProdBuild && isProdBuild &&
!isCI &&
new CompressionPlugin({ new CompressionPlugin({
cache: true, cache: true,
exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/], exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/],