laravel-mix injects unknown Javascript into my compiled JS
See original GitHub issue- Laravel Mix Version: 0.8.1
- Node Version (
node -v
): 7.5.0 - NPM Version (
npm -v
): 4.1.0 - OS: Windows 10
Description:
Whenever I compile my JS with laravel-mix, the combined file app.js contains some webpack-JavaScript, that stops my JS from working in the browser. The code looks somewhat like this:
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
etc...
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(0)))
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function($, jQuery) { ...}
Steps To Reproduce:
webpack.mix.js:
mix.js([
'resources/assets/js/jquery.ajaxsetup.js',
'resources/assets/js/jquery.document.ready.js',
'resources/assets/js/jquery.helpers.js',
'resources/assets/js/jquery.glossarium.vocab.js',
'resources/assets/js/jquery.glossarium.lektionen.js',
'resources/assets/js/jquery.glossarium.sachfelder.js',
'resources/assets/js/jquery.notifications.js',
'resources/assets/js/jquery.modal.js'], 'public/js/app.js')
npm run dev
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
laravel-mix injects unknown Javascript into my compiled JS
Whenever I compile my JS with laravel-mix, the combined file app.js contains some webpack-JavaScript, that stops my JS from working in the ......
Read more >Compiling Assets (Mix) - The PHP Framework For Web Artisans
Laravel Mix provides a fluent API for defining Webpack build steps for your Laravel application using several common CSS and JavaScript pre-processors.
Read more >JavaScript | Laravel Mix Documentation
Run npm run dev to compile it all down. At this point, simply create an HTML file, import your ./js/app.js bundle, and load...
Read more >combining js files in app.js in laravel 5 - Stack Overflow
First make sure you have latest nodejs installed and then run npm install after installation is done. On your webpack.mix.js add another ...
Read more >Webpack and bundlers · Bootstrap v5.0
Installing Bootstrap. Install bootstrap as a Node.js module using npm. Importing JavaScript. Import Bootstrap's JavaScript by adding this line to your app's ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use
mix.script()
It looks like you mostly want to concatenate files? If so, use
mix.combine()
instead.