Django integration for Laravel Mix
Project description
# Django Mix
Django integration for [Laravel Mix](https://github.com/JeffreyWay/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}/`)
```
Django integration for [Laravel Mix](https://github.com/JeffreyWay/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.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for djangomix-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 432cb35e53645ecbcb1fc07b78194c35ab44f6277ff772133f52dbf823c7cf65 |
|
MD5 | cbf78ad96ce9eb671b3e6cc5f423545a |
|
BLAKE2b-256 | a6e894df3000f902709fc2dc11cdc3a5baaabbc196d659e595bb6913119c7b08 |