From e98559c3ff79ccc9b5b866c5351416dd58f2ebee Mon Sep 17 00:00:00 2001 From: "Akihiko Odaki (@fn_aki@pawoo.net)" Date: Fri, 2 Jun 2017 03:56:32 +0900 Subject: Resolve custom application stylesheet with Webpack (#3373) This implementation is a bit smaller and still has the following benefits: * No need of app/javascript/packs/custom.js For custom stylesheet, it typically has only "require('../styles/custom.scss')" and is redundant. * No need to extract vendor stylesheet to another asset Extracting vendor stylesheet could be forgotten by developers who do not use custom stylesheet. --- app/helpers/style_helper.rb | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 app/helpers/style_helper.rb (limited to 'app/helpers') diff --git a/app/helpers/style_helper.rb b/app/helpers/style_helper.rb deleted file mode 100644 index b695f8f3e..000000000 --- a/app/helpers/style_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module StyleHelper - def stylesheet_for_layout - if asset_exist? 'custom.css' - 'custom' - else - 'application' - end - end - - def asset_exist?(path) - true if Webpacker::Manifest.lookup(path) - rescue Webpacker::FileLoader::NotFoundError - false - end -end -- cgit