From ba20756551b8deb67b0dfbbd48ff1708771370bb Mon Sep 17 00:00:00 2001 From: Guillermo Moreno Date: Thu, 3 Mar 2022 16:53:08 -0300 Subject: [PATCH] feat(front): add app/assets to paths --- lib/potassium/recipes/front_end.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/potassium/recipes/front_end.rb b/lib/potassium/recipes/front_end.rb index 0b4a797b..2238dd1f 100644 --- a/lib/potassium/recipes/front_end.rb +++ b/lib/potassium/recipes/front_end.rb @@ -30,6 +30,7 @@ def create after(:webpacker_install) do value = get(:front_end) recipe.copy_webpack_rules + recipe.add_assets_path recipe.setup_typescript recipe.setup_vue if value == :vue recipe.add_responsive_meta_tag @@ -62,6 +63,14 @@ def copy_webpack_rules copy_file '../assets/config/webpack/rules/typescript.js', 'config/webpack/rules/typescript.js' end + def add_assets_path + gsub_file( + 'config/webpacker.yml', + 'additional_paths: []', + "additional_paths: ['app/assets']" + ) + end + def setup_typescript run "bin/yarn add typescript fork-ts-checker-webpack-plugin ts-loader @types/node" copy_file '../assets/tsconfig.json', 'tsconfig.json'