diff --git a/lib/potassium/recipes/front_end.rb b/lib/potassium/recipes/front_end.rb index 16602920..e741f246 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'