Registry / web-framework / adonis-mix-asset

adonis-mix-asset

JSON →
library3.0.0jsnpmunverified

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.

npm install adonis-mix-asset
INSTALL
IMPORT
SIG · ADONIS-MIX-ASSET
A
adonis-mix-asset
web-frameworkjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mix
const mix = require('laravel-mix')
import mix from 'laravel-mix'
webpack.mix.js is a CommonJS config file; use require, not ESM import.
adonis-mix-asset
import 'adonis-mix-asset'
require('adonis-mix-asset')
AdonisJS providers are typically auto-loaded via ace configure; explicit import is only needed in edge cases.
mix view helper
{{ mix('path/to/asset') }}
{{ mix(['path']) }}
The view helper expects a string path, not an array. Used in Edge templates.

Install the package and configure it using AdonisJS ace command.

npm i adonis-mix-asset && npm i --save-dev laravel-mix node ace configure adonis-mix-asset
Debug
Known issues
breakingMajor 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.
fix
Upgrade to AdonisJS v5.1.7+ and install @adonisjs/view v6.0.2+.
affects: >=3.0.0
gotchaThe 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.
fix
Ensure mix.setPublicPath('public') matches the AdonisJS public path config.
affects: >=1.0.0
gotchaRunning node ace mix:build --production does not set NODE_ENV automatically; you may need to set it manually for production optimizations.
fix
Prefix with NODE_ENV=production or use cross-env.
affects: >=1.0.0
deprecatedIn v2, the package used to ship its own commands; v3 changed to using ace commands provided by the package.
fix
Run node ace mix:build or node ace mix:watch after configuration.
affects: >=3.0.0
gotchaAfter configuring, you must add mix-manifest.json and output folders (e.g., public/scripts) to .gitignore to avoid committing generated files.
fix
Add 'mix-manifest.json', 'public/scripts', 'public/styles' to .gitignore.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module '@adonisjs/core/src/Helpers'
Incompatible AdonisJS version (v4 vs v5) with adonis-mix-asset >=3.0.0.
fix
Upgrade AdonisJS to ^5.1.7 and use adonis-mix-asset v3.
mix is not a function
Using ESM import instead of CommonJS require in webpack.mix.js.
fix
Change to const mix = require('laravel-mix');
View helper mix() returns empty string
mix-manifest.json not found or public path mismatch.
fix
Ensure mix.setPublicPath('public') matches your AdonisJS public directory.
Command 'mix:build' not found
Provider not registered or outdated ace commands.
fix
Run node ace configure adonis-mix-asset again and ensure the provider is in .adonisrc.json.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
@adonisjs/corerequiredPeer dependency required for AdonisJS core functionality
@adonisjs/viewrequiredPeer dependency required for view helper to generate asset URLs
laravel-mixrequiredPeer dependency required for asset bundling via webpack
Agent activity
34 hits · last 30 days
node
28
OpenAI (training)
2
Resources
adonis-mix-asset — npm install adonis-mix-asset · libregistry