Closed cyberfly closed 4 years ago
Hi @cyberfly,
I mean in APP folder, but it is mainly on you. You are able to configure paths in webpack.mix.js as you prefer.
Your source files are not existing that is reason why you're getting the error.
Yes it is correct. First you need source file like app.js which will be processed by Laravel mox (webpack) and you get your outpup file in static (path can be managed in webpack.mix.js). Without source file it does not have sence to use laravel mix.
You need this line if you want process js files and sass files. If you need process only .js files your code will be:
mix.js('src/app.js', 'dist/');
That's okay, it depends on how your code is organised
If the source code of js/css.. is same, you do not have to. You can place also resources folder and webpack.mix.js to root of your project (everything depends how you configure it)
It depends what you need. Component are part of Vue (in tutorial) docs: https://vuejs.org/v2/guide/components-registration.html . Vue components are reusable and you can use it multiple times. When you need same component to multiple apps you can have your django app in django app or you can have components in project root.
Again it depends how you have configured your webpack.mix.js. In tutorial webpack.mix.js is located in root folder and all paths are set in the file. Resources folder is in app polls.
<script src="{% mix 'build/app.js' 'polls/static' %}"></script>
npm run watch should re-compile every change silmilar to hot but hot is working as hot-module reloading.
Thanks I got everything working correctly, except one problem:
I got it solve by follow the guide here
Hi,
I follow your Medium tutorial here https://medium.com/@marek_94752/how-to-start-with-vue-or-any-other-framework-lib-in-django-in-few-minutes-b34fd4291f7
Thanks for the write up, however I face several error and need to ask some question. Using python3.6 and latest django. I am newbie in django
Lets assume resources folder is inside app folder. Currently I dont have any static folder to copy, so my resources folder is empty
So if I run
npm run dev
command, it will return an errorsettings.py
Example
webpack.mix.js
Thanks