From 1d2284068a886e1c257cc019186906d3a9fb613f Mon Sep 17 00:00:00 2001 From: "rjwats@gmail.com" Date: Thu, 29 Mar 2018 09:57:52 +0100 Subject: [PATCH] add css override to reduce file path length --- interface/config-overrides.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/config-overrides.js b/interface/config-overrides.js index 43a71d7..ad57d6a 100644 --- a/interface/config-overrides.js +++ b/interface/config-overrides.js @@ -1,6 +1,7 @@ const CompressionPlugin = require("compression-webpack-plugin"); const ManifestPlugin = require('webpack-manifest-plugin'); const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); const path = require('path'); const fs = require('fs'); @@ -9,7 +10,7 @@ module.exports = function override(config, env) { if (env === "production") { // rename the ouput file, we need it's path to be short, for SPIFFS config.output.filename = 'js/[name].[chunkhash:4].js'; - + // disable sourcemap for production build config.devtool = false; @@ -17,6 +18,9 @@ module.exports = function override(config, env) { config.plugins = config.plugins.filter(plugin => !(plugin instanceof ManifestPlugin)); config.plugins = config.plugins.filter(plugin => !(plugin instanceof SWPrecacheWebpackPlugin)); + const extractTextPlugin = config.plugins.find((plugin) => plugin instanceof ExtractTextPlugin); + extractTextPlugin.filename = "css/[name].[contenthash:4].css"; + // add compression plugin, compress javascript, html and css config.plugins.push(new CompressionPlugin({ asset: "[path].gz[query]",