Skip to content

Instantly share code, notes, and snippets.

Charles Bochet charlesBochet

  • LuckeyHomes
  • Paris
Block or report user

Report or block charlesBochet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View webpack.backoffice.mix.js
const mix = require('laravel-mix');
require('laravel-mix-merge-manifest')
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
View webpack.mix.js
if (['customers', 'backoffice'].includes(process.env.npm_config_section)) {
require(`${__dirname}/webpack.${process.env.npm_config_section}.mix.js`)
} else {
console.log(
'\x1b[41m%s\x1b[0m',
'Provide correct --section argument to build command: customers, backoffice'
)
throw new Error('Provide correct --section argument to build command!')
}
View package.json
"scripts": {
"dev-all": "concurrently \"npm --section=backoffice run dev\" \"npm --section=customers run dev\" --kill-others-on-fail",
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
View webpack.mix.js
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
View webpack.mix.js
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
View backoffice.js
require('./bootstrap');
$(".hello-world-container-jquery" ).html("Hello Word with jQuery")
View customers.js
import Vue from 'vue'
Vue.component('hello-world', require('./HelloWorld.vue'));
const app = new Vue({
el: '#app'
});
View HelloWorld.vue
<template>
<div class="container">
Hello World with vue
</div>
</template>
<script>
export default {
mounted() {
console.log('Hello World')
View webpack.mix.js
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
View customers.blade.php
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Customers</title>
</head>
<body>
<div class="flex-center position-ref full-height">
You can’t perform that action at this time.