palkan / view_component-contrib

A collection of extension and developer tools for ViewComponent
MIT License
369 stars 22 forks source link

add webpacker resolved paths #3

Closed michelson closed 3 years ago

michelson commented 3 years ago

What did you do?

add a stimulus with a static target

What did you expect to happen?

compile ok

What actually happened?

compiled with warnings

Additional context

WARNING in ./app/frontend/components/definition_renderer/index.js 7:16
Module parse failed: Unexpected token (7:16)
You may need an appropriate loader to handle this file type. Currently, no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| 
| export class Controller extends BaseController {
>       static targets = ['form']
| 
|       connect() {

Environment

Ruby Version: 2.7.2 Framework Version (Rails, whatever): 6.0.1.3 View Component Contrib Version: view_component (2.34.0) activesupport (>= 5.0.0, < 7.0) view_component-contrib (0.1.0)

adding resolved_paths: ['app/frontend/components'] actually solves this

palkan commented 3 years ago

Thanks!

Added a warning to the generator.

https://github.com/palkan/view_component-contrib/commit/eac8a76a02f26ac9b55f3e1c14690b190bcccd01