Django integration for Laravel Mix
Project description
Django Mix
Django integration for Laravel Mix
Laravel Mix helper in python representation to easy usage with laravel-mix npm package in Django projects.
Usage
<script src="{% mix 'app.js' 'polls/static' %}"></script>
The paths are related to webpack.mix.js configuration.
This example use following configration of webpack.mix.js:
let mix = require('laravel-mix');
let staticPath = 'polls/static'
let resourcesPath = 'polls/resources'
if (process.argv.includes('--browser-sync')) {
mix.browserSync('localhost:8000')
}
// setResroucesRoots add prefix to url() in scss on example: from /images/close.svg?a898fb5d07d8c21381d4566b74e12d93 to /static/images/close.svg?a898fb5d07d8c21381d4566b74e12d93
mix.setResourceRoot('/static/')
mix.setPublicPath('polls/static/')
mix.js(`${resourcesPath}/js/app.js`, `${staticPath}/`)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djangomix-1.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for djangomix-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5ff4a40da6fd465bb6c28362fc6ba89570033f28ffb298f6996ddc645e732bc |
|
MD5 | 6d766361192cf71fffe74fa3620cd7ae |
|
BLAKE2b-256 | f188e0c3e6e6d192306dae75b5ce0cb2b8ad44fe73fa0f45b8b417fd22758737 |