Skip to content

Commit

Permalink
feat(front): add app/assets to paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gmq committed Mar 3, 2022
1 parent e07e0d6 commit 342d770
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/potassium/recipes/front_end.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 342d770

Please sign in to comment.