Answer the question
In order to leave comments, you need to log in
How to register your JS in laravel mix/webpack?
I'm not sure about the correct approach, but I want to import my js code into the main app.js when building via npm run dev
I do this - in app.js I add it
to plugins/filters.js
require('./plugins/filters');
function test() {
console.log('aaa');
}
/***/ "./resources/js/plugins/filters.js":
/*!*****************************************!*\
!*** ./resources/js/plugins/filters.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function test() {
console.log('aaa');
}
Answer the question
In order to leave comments, you need to log in
How can I access my test() function now?
window.test = function () {
console.log('aaa');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question