{"id":18094,"library":"adonis-mix-asset","title":"Adonis Mix Asset","description":"Laravel Mix integration for AdonisJS, providing asset bundling with webpack and a view helper. Current stable version is 3.0.0, requiring @adonisjs/core ^5.1.7, @adonisjs/view ^6.0.2, and laravel-mix ^6.0.19. It simplifies using Laravel Mix's webpack configuration within AdonisJS, offering commands for building, watching, and analyzing assets. Differentiators include automatic mix-manifest.json parsing and a view helper for cache-busted asset URLs.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/wahyubucil/adonis-mix-asset","tags":["javascript","AdonisJS","Adonis Laravel Mix","Adonis asset bundler"],"install":[{"cmd":"npm install adonis-mix-asset","lang":"bash","label":"npm"},{"cmd":"yarn add adonis-mix-asset","lang":"bash","label":"yarn"},{"cmd":"pnpm add adonis-mix-asset","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for AdonisJS core functionality","package":"@adonisjs/core","optional":false},{"reason":"Peer dependency required for view helper to generate asset URLs","package":"@adonisjs/view","optional":false},{"reason":"Peer dependency required for asset bundling via webpack","package":"laravel-mix","optional":false}],"imports":[{"note":"webpack.mix.js is a CommonJS config file; use require, not ESM import.","wrong":"import mix from 'laravel-mix'","symbol":"mix","correct":"const mix = require('laravel-mix')"},{"note":"AdonisJS providers are typically auto-loaded via ace configure; explicit import is only needed in edge cases.","wrong":"require('adonis-mix-asset')","symbol":"adonis-mix-asset","correct":"import 'adonis-mix-asset'"},{"note":"The view helper expects a string path, not an array. Used in Edge templates.","wrong":"{{ mix(['path']) }}","symbol":"mix view helper","correct":"{{ mix('path/to/asset') }}"}],"quickstart":{"code":"npm i adonis-mix-asset && npm i --save-dev laravel-mix\nnode ace configure adonis-mix-asset\n","lang":"javascript","description":"Install the package and configure it using AdonisJS ace command."},"warnings":[{"fix":"Upgrade to AdonisJS v5.1.7+ and install @adonisjs/view v6.0.2+.","message":"Major breaking changes between v2 and v3: v3 requires @adonisjs/core ^5.1.7 and @adonisjs/view ^6.0.2, and rewrote implementation for latest AdonisJS.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure mix.setPublicPath('public') matches the AdonisJS public path config.","message":"The view helper {{ mix('...') }} returns a URL based on mix-manifest.json. If you change public path in AdonisJS, you must also set mix.setPublicPath() accordingly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Prefix with NODE_ENV=production or use cross-env.","message":"Running node ace mix:build --production does not set NODE_ENV automatically; you may need to set it manually for production optimizations.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run node ace mix:build or node ace mix:watch after configuration.","message":"In v2, the package used to ship its own commands; v3 changed to using ace commands provided by the package.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Add 'mix-manifest.json', 'public/scripts', 'public/styles' to .gitignore.","message":"After configuring, you must add mix-manifest.json and output folders (e.g., public/scripts) to .gitignore to avoid committing generated files.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Upgrade AdonisJS to ^5.1.7 and use adonis-mix-asset v3.","cause":"Incompatible AdonisJS version (v4 vs v5) with adonis-mix-asset >=3.0.0.","error":"Cannot find module '@adonisjs/core/src/Helpers'"},{"fix":"Change to const mix = require('laravel-mix');","cause":"Using ESM import instead of CommonJS require in webpack.mix.js.","error":"mix is not a function"},{"fix":"Ensure mix.setPublicPath('public') matches your AdonisJS public directory.","cause":"mix-manifest.json not found or public path mismatch.","error":"View helper mix() returns empty string"},{"fix":"Run node ace configure adonis-mix-asset again and ensure the provider is in .adonisrc.json.","cause":"Provider not registered or outdated ace commands.","error":"Command 'mix:build' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}