{"id":23872890,"url":"https://github.com/paysera/lib-maba-webpack-extension-bundle","last_synced_at":"2025-09-08T23:31:59.762Z","repository":{"id":57036844,"uuid":"162888672","full_name":"paysera/lib-maba-webpack-extension-bundle","owner":"paysera","description":"Bundle provides extensions for maba/webpack-bundle to integrate better into developer environment","archived":false,"fork":false,"pushed_at":"2020-12-14T08:11:31.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-25T12:06:07.109Z","etag":null,"topics":["development-environment","docker","import-no-unresolved","maba-webpack","webpack"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paysera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-23T12:26:21.000Z","updated_at":"2020-12-14T08:11:34.000Z","dependencies_parsed_at":"2022-08-23T20:51:02.468Z","dependency_job_id":null,"html_url":"https://github.com/paysera/lib-maba-webpack-extension-bundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-maba-webpack-extension-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-maba-webpack-extension-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-maba-webpack-extension-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-maba-webpack-extension-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paysera","download_url":"https://codeload.github.com/paysera/lib-maba-webpack-extension-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232363094,"owners_count":18511671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development-environment","docker","import-no-unresolved","maba-webpack","webpack"],"created_at":"2025-01-03T16:36:00.122Z","updated_at":"2025-01-03T16:36:00.948Z","avatar_url":"https://github.com/paysera.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib-maba-webpack-extension-bundle\n\nThis Bundle allows developer to hook into `maba/webpack-bundle` webpack.config.js dumping process and make changes\nneeded for developer environment.\n\n## Why?\n\nWhen working with `maba/webpack-bundle` aliases, you can often end up in situation where neither IDE (PHPStorm) or Eslint\ngets happy when you import something like this:\n```js\nimport { StaticTextFormGroup } from '@app/js/common/components/StaticText';\nimport { CheckboxFieldFormGroup } from '@app/js/common/components/CheckboxField';\n```\n1. Eslint yells on you about `import/no-unresolved`;\n1. IDE (PHPStorm) does not helps you also - no navigation to imported module (ctrl + click);\n\nThis is because you run your project from `Docker` (or any other) container, paths in `webpack.config.js` are valid only from container\nbut not from host, so IDE (PHPStorm) fails to recognize paths in `webpack.config.js`.\n\n## Installation\n\n```bash\ncomposer require --dev paysera/lib-maba-webpack-extension-bundle\n```\n\nIn your `AppKernel`:\n```php\n    if (in_array($this-\u003egetEnvironment(), array('dev', 'test'))) {\n        // ...\n        $bundles[] = new Paysera\\Bundle\\MabaWebpackExtensionBundle\\PayseraMabaWebpackExtensionBundle();\n    }\n```\n\n## Configuration\n\n##### As this Bundle is only needed for development purposes, we suggest you to configure it only in `config_dev.yml`.\n\nBundle exposes these options:\n```yaml\npaysera_maba_webpack_extension:\n    replace_paths:\n        /home/app/src: \"/home/me/Projects/my-project\"\n    replace_items:\n        webpack_config_path: true\n        alias: true\n        manifest_path: true\n        entry: false\n    replaced_webpack_config_path: \"%kernel.cache_dir%/webpack.config_%kernel.environment%.js\"\n\nmaba_webpack:\n    aliases:\n        prefix: '%' # change the prefix to something different than \"@\"\n```\n\n* `replace_paths` - `array` of key-value paths to replace in `webpack.config.js`.\n* `replace_items` - `array` of switches where to use `replace_paths` on.\n* `replaced_webpack_config_path` - `string` where to put modified `webpack.config.js`.\n* change the default `maba_webpack.aliases.prefix` to something different than `@`, `#` or `!`\n\n## Recommended setup\n\nIn your `config_dev.yml`:\n```yaml\npaysera_maba_webpack_extension:\n    replace_paths:\n        /home/app/src: \"/home/me/Projects/my-project\"\n```\n\nInstall `eslint-import-resolver-webpack` and configure your `.eslintrc` settings with:\n```json\n  \"settings\": {\n    \"import/resolver\": {\n      \"webpack\": {\n        \"config\": \"app/cache/dev/webpack.config_dev.js\"\n      }\n    }\n  }\n```\nWith these lines you'll be able to get rid of `import/no-unresolved` message.\n\n### IDE config\n\nJust change IDE's `webpack.config.js` to `app/cache/dev/webpack.config_dev.js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaysera%2Flib-maba-webpack-extension-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaysera%2Flib-maba-webpack-extension-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaysera%2Flib-maba-webpack-extension-bundle/lists"}