How to use the laravel-mix.setPublicPath function in laravel-mix

To help you get started, we’ve selected a few laravel-mix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ben-rogerson / agency-webpack-mix-config / webpack.mix.js View on Github external
const mix = require("laravel-mix")
const path = require("path")
const globby = require("globby")

// 🎚️ Source folders
const source = {
    icons: path.resolve("src/icons"),
    images: path.resolve("src/images"),
    scripts: path.resolve("src/scripts"),
    styles: path.resolve("src/styles"),
    static: path.resolve("src/static"),
    templates: path.resolve("src/templates"),
}

// 🎚️ Misc
mix.setPublicPath(config.publicFolder)
mix.disableNotifications()
mix.webpackConfig({ resolve: { alias: source } })
!mix.inProduction() && mix.sourceMaps()

/**
 * 🏠 Templates (for static sites)
 * Convert Twig files to Html
 * https://github.com/ben-rogerson/laravel-mix-twig-to-html
 */
if (config.buildStaticSite && source.templates) {
    require("laravel-mix-twig-to-html")
    mix.twigToHtml({
        files: [
            {
                template: path.resolve(
                    __dirname,
github alithedeveloper / sage-vue-tailwind / webpack.mix.js View on Github external
// Source path helper
const src = path => `resources/assets/${path}`;

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Sage application. By default, we are compiling the Sass file
 | for your application, as well as bundling up your JS files.
 |
 */

// Public Path
mix
  .setPublicPath('./dist')
  .setResourceRoot(`/app/themes/sage/${mix.config.publicPath}/`)
  .webpackConfig({
    output: {publicPath: mix.config.resourceRoot}
  });

// Browsersync
mix.browserSync('tech-bits.website');

// Styles
mix.sass(src`styles/app.scss`, 'styles');

// JavaScript
mix.js(src`scripts/app.js`, 'scripts')
  .js(src`scripts/customizer.js`, 'scripts')
  .extract();
github area17 / twill / webpack.mix.js View on Github external
let mix = require('laravel-mix')

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application.
 |
 */

mix.setPublicPath('public')

mix.options({
  processCssUrls: false,
  purifyCss: false // Remove unused CSS selectors.
})

mix.webpackConfig({
  resolve: {
    alias: {
      '@': path.resolve('frontend/js'),
      'styles': path.resolve('frontend/scss')
    }
  },
  module: {
    rules: [
      {
github rappasoft / laravel-boilerplate / webpack.mix.js View on Github external
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.
 |
 */

mix.setPublicPath('public')
    .setResourceRoot('../') // Turns assets paths in css relative to css file
    .sass('resources/sass/frontend/app.scss', 'css/frontend.css')
    .sass('resources/sass/backend/app.scss', 'css/backend.css')
    .js('resources/js/frontend/app.js', 'js/frontend.js')
    .js('resources/js/backend/app.js', 'js/backend.js')
    .extract([
        'alpinejs',
        'jquery',
        'bootstrap',
        'popper.js',
        'axios',
        'sweetalert2',
        'lodash'
    ])
    .sourceMaps();
github Darwin-River / Ex-Machinis / webpack.mix.js View on Github external
let 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.
 |
 */
mix.setPublicPath('html/');
mix.js('resources/assets/js/app.js', 'html/js')

    .sass('resources/assets/sass/app.scss', 'html/css')/*.autoload({
    jQuery: 'jquery',
    $: 'jquery',
    jquery: 'jquery'

}) */  /*.js('resources/assets/js/core.min.js', 'html/js')
    .js('resources/assets/js/script.js', 'html/js')*/;
github ProVisionBG / administration / webpack.mix.js View on Github external
/*
 * Copyright (c) 2019. ProVision Media Group Ltd. 
 * Venelin Iliev 
 */

const mix = require('laravel-mix')
    .setPublicPath(path.normalize('public'))
    .setResourceRoot('../');

/*
 |--------------------------------------------------------------------------
 | 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.
 |
 */

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');
github avored / laravel-ecommerce / modules / avored / banner / webpack.mix.js View on Github external
let mix = require('laravel-mix')

mix.setPublicPath('dist')
    .js('resources/js/banner.js', 'js/banner.js')
github runlinenl / nova-profile-tool / webpack.mix.js View on Github external
let mix = require('laravel-mix')

mix.setPublicPath('./');
mix.js('resources/js/tool.js', 'dist/js');
mix.sass('resources/sass/tool.scss', 'dist/css');
github yassipad / laravel-nova-nested-form / webpack.mix.js View on Github external
let mix = require('laravel-mix')

mix
  .setPublicPath('dist')
  .js('resources/js/field.js', 'js')
  .webpackConfig({
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './vendor/laravel/nova/resources/js/')
      }
    }
  })
github swisnl / laravel-nova-mirror / src / Console / asset-stubs / webpack.mix.js View on Github external
let mix = require('laravel-mix')

mix.setPublicPath('dist')
    .js('resources/js/asset.js', 'js')
    .sass('resources/sass/asset.scss', 'css')