laravel-mix

Laravel-mix no build notification

半腔热情 提交于 2019-12-10 16:56:58
问题 I'm using Vue.js and Laravel-Mix, when I save the project I don't receive any notification like this : I'm running npm run watch . My console doesn't display any errors / warnings when I compile. I already checked the webpack.mix.js for mix.disableSuccessNotifications(); and I don't have that on my file, my notifications are working on my OS. I'm using Linux Mint. I have this on package.json : "watch": "node_modules/.bin/webpack --watch --watch-poll --config=node_modules/laravel-mix/setup

Laravel 5.4 Webpack Mix - merge SCSS and CSS

对着背影说爱祢 提交于 2019-12-10 16:41:51
问题 Is there any way to merge SCSS and CSS? Currently I do it as follows but it doesn't work. The code below supposed to compile scss into a temp directory and then merge it with the plain css. mix.sass('resources/assets/sass/app.scss', '../resources/assets/tmp_compilation_files/scss-assets.css').styles([ 'resources/assets/tmp_compilation_files/scss-assets.css', 'node_modules/isteven-angular-multiselect/isteven-multi-select.css' ], 'public/css/app.css'); but nothing. The compiled SASS is missing

vuejs + babel-loader this.setDynamic is not a function

时光毁灭记忆、已成空白 提交于 2019-12-10 15:02:58
问题 I have some problems with my code. I'm trying to add babel-loader to my laravel-mix webpack's config, but I get an error telling me that this.setDynamic is not a function. This is my webapack-mix.js file const {mix} = require('laravel-mix'); const VueLoaderPlugin = require('vue-loader/lib/plugin') /* |-------------------------------------------------------------------------- | Mix Asset Management |-------------------------------------------------------------------------- | | Mix provides a

Images have absolute path - How to use a subdirectory URL in LaravelMix

最后都变了- 提交于 2019-12-10 09:39:43
问题 My Laravel Mix app will be placed in a subdirectory on the server like: http://localhost/pat-os-server/public/ An image's path in my vue component compiles from <img id="logo" src="../assets/img/pat_logo.png"> To <img id="logo" src="/images/pat_logo.png"> Now the image is not shown due to the subdirectory the app is in. The correct path should be either images/pat_logo.png (relative - prefered) or /pat-os-server/public/images/pat_logo.png (absolute) I've tried to set the output path in

Laravel mix transpile dependency

微笑、不失礼 提交于 2019-12-08 04:25:29
I'm trying to use the vuex-module-decorators library in a laravel mix project (using typescript). But I keep getting the error Uncaught TypeError: Class constructor VuexModule cannot be invoked without 'new' . This seems to be a known issue and can be resolved by adding transpileDependencies: ['vuex-module-decorators'] to my vue.config.js file which will tell babel to transpile the package. Since I'm using laravel mix, adding a vue.config.js file doesn't do anything. And I can't figure out how to tell laravel mix to transpile the vuex-module-decorators dependency. I tried adding { test: /\.js$

Laravel mix transpile dependency

社会主义新天地 提交于 2019-12-08 03:55:01
问题 I'm trying to use the vuex-module-decorators library in a laravel mix project (using typescript). But I keep getting the error Uncaught TypeError: Class constructor VuexModule cannot be invoked without 'new' . This seems to be a known issue and can be resolved by adding transpileDependencies: ['vuex-module-decorators'] to my vue.config.js file which will tell babel to transpile the package. Since I'm using laravel mix, adding a vue.config.js file doesn't do anything. And I can't figure out

How to use laravel mix define global javascript function

丶灬走出姿态 提交于 2019-12-07 23:04:03
问题 I already have a function in resources/assets/js/common/utils.js 'use strict' function test(){ console.log('test'); } How can I define utils.js as a global file and to be use any where? Thanks for read my question! 回答1: If you need to use it outside of your bundled JavaScript files you can attach it to the window object window.test = function () { console.log('test'); } Which you can then use in other files, such as your blade template files as window.test(); Or if you want to use it within

How can I change the public path to something containing an underscore in Laravel Mix?

馋奶兔 提交于 2019-12-06 19:20:57
问题 In Laravel 5.4 Mix was introduced to compile assets and maintain the asset pipeline. Mix defaults to your public directory being named public . In many cases, including mine, my public directory is called something else. In my case, it's public_html . How can I change the public directory where assets are compiled to? I have tried changing the paths within webpack.min.js to: mix.js('resources/assets/js/app.js', 'public_html/assets/js') .sass('resources/assets/sass/app.scss', 'public_html

How to use laravel mix define global javascript function

為{幸葍}努か 提交于 2019-12-06 13:45:07
I already have a function in resources/assets/js/common/utils.js 'use strict' function test(){ console.log('test'); } How can I define utils.js as a global file and to be use any where? Thanks for read my question! If you need to use it outside of your bundled JavaScript files you can attach it to the window object window.test = function () { console.log('test'); } Which you can then use in other files, such as your blade template files as window.test(); Or if you want to use it within your bundled JavaScript files you can import it as a module // test.js export default function test() {

Can't read property of undefined (mix.initialize() )when use node_modules/.bin/webpack

杀马特。学长 韩版系。学妹 提交于 2019-12-06 04:23:06
I'm trying to compile with node_modules/.bin/webpack and I get this error: Mix.initialize(); ^ TypeError: Cannot read property 'initialize' of undefined at Object.<anonymous> (/home/vagrant/Code/stream/webpack.config.js:9:4) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at requireConfig (/home/vagrant/Code/stream/node_modules/webpack/bin/convert-argv.js:97:18) at