Example #1
0
let mix = require('laravel-mix');
let build = require('./tasks/build.js');
let tailwindcss = require('tailwindcss');

mix.disableSuccessNotifications();
mix.setPublicPath('source/assets/build');
mix.webpackConfig({
    plugins: [
        build.jigsaw,
        build.browserSync(),
        build.watch([
            'source/**/*.md',
            'source/**/*.php',
            'source/**/*.scss',
            '!source/**/_tmp/*',
            'config.php',
            'config.production.php'
        ]),
    ]
});

mix.js('source/_assets/js/main.js', 'js')
    .sass('source/_assets/sass/main.scss', 'css')
    .options({
        processCssUrls: false,
        postCss: [ tailwindcss('./tailwind.js') ],
    }).version();
Example #2
0
let mix = require('laravel-mix');
let path = require('path');

/*
 |--------------------------------------------------------------------------
 | 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(path.join('public', 'assets'));
mix.setResourceRoot('/assets/');
mix.sourceMaps(! mix.inProduction());
mix.disableNotifications();

if (mix.config.hmr === true) {
  mix.setResourceRoot('/');
}

/*
 |--------------------------------------------------------------------------
 | Bootstrap SASS & jQuery bundle.
 |--------------------------------------------------------------------------
 |
 | 包含 jQuery 和 Bootstrap 的捆包。
 |
 */
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');

mix.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/before.js',
        'resources/js/backend/app.js',
        'resources/js/backend/after.js'
    ], 'js/backend.js')
    .extract([
        'jquery',
        'bootstrap',
        'popper.js/dist/umd/popper',
        'axios',
        'sweetalert2',
        'lodash',
        '@fortawesome/fontawesome-svg-core',
Example #4
0
let mix = require( 'laravel-mix' );
let path = require( 'path' );

/*
 |--------------------------------------------------------------------------
 | 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 your application, as well as bundling up your JS files.
 |
 */

mix.setPublicPath( path.join( 'assets', 'dist' ) )
	.js( 'assets/src/scripts/anchor.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/applyclass.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/book-information.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/catalog.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/cloner.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/color-picker.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/export.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/footnote.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/ftnref-convert.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/import.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/network-managers.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/organize.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/quicktags.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/search-and-replace.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/small-menu.js', 'assets/dist/scripts/' )
	.js( 'assets/src/scripts/textboxes.js', 'assets/dist/scripts/' )
Example #5
0
let mix = require('laravel-mix');
const proxy_url = process.env.MIX_URL_PROXY;
const config = require('./config.json');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your WP theme. By default, we are compiling the Sass
 | file for your application, as well as bundling up your JS files.
 |
 */
mix.setPublicPath(config.paths.build);
mix.setResourceRoot(config.paths.root);

mix.js(`${config.paths.assets}/${config.scripts}`, `${config.paths.build}/scripts/`)
    .extract(config.extract)
    .sass(`${config.paths.assets}/${config.sass}`, `${config.paths.build}/styles/`)
    .copy(`${config.paths.assets}/images/**/*.{png,jpg,jpeg,gif,svg,ico}`, `${config.paths.build}/images`, false)
    .copy(`${config.paths.assets}/fonts/**/*.{eot,svg,ttf,otf,woff,woff2}`, `${config.paths.build}/fonts`, false);


mix.options({
    // processCssUrls: false,
    vue: {
        esModule: true
    },
    // extractVueStyles: `${config.paths.build}/${config.vue_css}` // Path or boolean
Example #6
0
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')
    .js('resources/js/theme.js', 'js')
    .sass('resources/sass/theme.scss', 'css')
    .version()
Example #7
0
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 your application, as well as bundling up your JS files.
 |
 */
mix.setPublicPath('dist');

mix.js('assets/js/theme.js', 'dist/js/theme.min.js')
    .sass('assets/sass/style.scss', 'dist/css/theme.css')
    .sass('assets/sass/woocommerce.scss', 'dist/css');
Example #8
0
/*
 |--------------------------------------------------------------------------
 | 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 your application, as well as bundling up your JS files.
 |
 */

const theme = 'jazzweb';
const public_folder = 'public_html';
const theme_assets = `${public_folder}/themes/${theme}/assets`;

mix.setPublicPath(path.normalize(`${theme_assets}`));

mix.js('assets/js/app.js', 'js');
mix.less('assets/less/app.less', 'css');

//Copy Bootstrap
mix.copy('node_modules/bootstrap/dist/css/bootstrap.min.css', `${theme_assets}/vendor/bootstrap/bootstrap.min.css`);
mix.copy('node_modules/bootstrap/dist/js/bootstrap.min.js', `${theme_assets}/vendor/bootstrap/bootstrap.min.js`);

//Copy Popper.js
mix.copy('node_modules/popper.js/dist/umd/popper.min.js', `${theme_assets}/vendor/popper/popper.min.js`);

//Copy jQuery
mix.copy('node_modules/jquery/dist/jquery.min.js', `${theme_assets}/vendor/jquery/jquery.min.js`);

// Full API
Example #9
0
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('assets');
mix.setResourceRoot('/assets/plus-id');
mix.sourceMaps(! mix.inProduction());

// More documents see: https://laravel.com/docs/master/mix
mix.js('resources/assets/main.js', 'assets/app.js');
Example #10
0
/*
 |--------------------------------------------------------------------------
 | 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 your application, as well as bundling up your JS files.
 |
 */

let domain = 'themosis';
let from = './resources/assets';
let to = './dist';

mix
  .setPublicPath( to )
  
  // GUEST
  .js( from + '/guest/js/app.js', '/js/app.js')
  .sass( from + '/guest/sass/app.scss', '/css/app.css')

  // ADMIN
  .js( from + '/admin/js/app.js', '/js/admin.js')
  .sass( from + '/admin/sass/app.scss', '/css/admin.css')

  // ASSETS
  .copyDirectory( from + '/images'  , to + '/images'  )
  .copyDirectory( from + '/fonts'  , to + '/fonts'  )
  .copyDirectory( from + '/favicon'  , to + '/favicon'  )
  
  .browserSync({
Example #11
0
if (!mix.inProduction()) {
    mix.webpackConfig({ devtool: `inline-source-map` });

    const Config = require('./back-end/config/Config');
    mix.browserSync({
        proxy: `localhost:${Config.getServerPort()}`,
        injectChanges: false,
        files: [`dashboard/**/*`],
    });

    mix.disableSuccessNotifications();
}

mix.version();

mix.setPublicPath(`dashboard/`);

mix.then(() => {
    const replacements = [
        { key: 'bust', value: new Date().getTime() },
        { key: 'version', value: VersionChecker.getCurrentVersion() },
    ];

    fileSystem.readFile('front-end/index.html', 'utf8', (error, data) => {
        if (error) {
            console.error('Could not load the source index file.', error);
            return;
        }

        for (let index in replacements) {
            data = data.replace(new RegExp(`---${replacements[index].key}---`, 'g'), replacements[index].value);
Example #12
0
mix.disableNotifications()

mix.browserSync({
  open: false,
  proxy: 'sqlgreygui.local',
  files: [
    'app/**/*.php',
    'resources/views/**/*.php',
    'resources/views/**/*.twig',
    'public/assets/js/**/*.js',
    'public/assets/css/**/*.css'
  ]
})

mix.setPublicPath('public/assets')
mix.setResourceRoot('/assets/')

mix.sass('resources/assets/sass/style.scss', 'css')
  .js('resources/assets/js/app.js', 'js')
  .js('resources/assets/js/public.js', 'js')
  .extract([
    'axios',
    'lodash',
    'vue',
    'vuex',
    'vue-events',
    'vue-focus',
    'vue-sweetalert',
    'vue-strap'
  ])
Example #13
0
const mix_ = require('laravel-mix');

var _asset = './assets/';

mix_.setPublicPath('./dist')
    .js([
        _asset + 'js/plugins/bootstrap/transition.js',
        _asset + 'js/plugins/bootstrap/alert.js',
        _asset + 'js/plugins/bootstrap/button.js',
        _asset + 'js/plugins/bootstrap/carousel.js',
        _asset + 'js/plugins/bootstrap/collapse.js',
        _asset + 'js/plugins/bootstrap/dropdown.js',
        _asset + 'js/plugins/bootstrap/modal.js',
        _asset + 'js/plugins/bootstrap/tooltip.js',
        _asset + 'js/plugins/bootstrap/popover.js',
        _asset + 'js/plugins/bootstrap/scrollspy.js',
        _asset + 'js/plugins/bootstrap/tab.js',
        _asset + 'js/plugins/bootstrap/affix.js',
        _asset + 'js/_main.js'
    ], 'js/main.min.js')
    .scripts(_asset + 'js/modernizr.custom.js', 'dist/js/modernizr.js')
    .less(_asset + 'less/app.less', 'dist/css/main.min.css')
    .options({
        processCssUrls: false
    })
    .styles([
        _asset + 'fonts/fontello/css/fontello.css',
        _asset + 'fonts/proximanova/proximanova.css',
        _asset + 'css/GentiumBookBasic.css'
    ], 'dist/css/fonts.css')
    .styles(_asset + 'fonts/fontello/css/fontello-ie7.css', 'dist/css/fontello-ie7.css')
Example #14
0
let mix = require('laravel-mix');

// Configure base path for mix stuff going to web
mix.setPublicPath('www/media/');

// Configure base path for media assets
mix.setResourceRoot('/media/');

/*
 * Copy and build vendor packages
 */

// jQuery
mix.copy('node_modules/jquery/dist/jquery.min.js', 'www/media/js/vendor/jquery.js');

// Bootstrap v2.3.2 release order: bootstrap-transition.js, bootstrap-alert.js, bootstrap-button.js, bootstrap-carousel.js, bootstrap-collapse.js, bootstrap-dropdown.js, bootstrap-modal.js, bootstrap-tooltip.js, bootstrap-popover.js, bootstrap-scrollspy.js, bootstrap-tab.js, bootstrap-typeahead.js, bootstrap-affix.js
// TODO - Just pull the modified version from the CMS?
mix.combine(
    [
        'node_modules/bootstrap-2.3.2/js/bootstrap-transition.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-collapse.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-dropdown.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-modal.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-tooltip.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-popover.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-scrollspy.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-tab.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-typeahead.js',
        'node_modules/bootstrap-2.3.2/js/bootstrap-affix.js',
    ],
    'www/media/js/vendor/bootstrap.js'
Example #15
0
let mix = require('laravel-mix')

let scssOptions = {
    processCssUrls: false
}

let bundles = {
    'all': [
        './src/js/app.js'
    ]
}

let extractLibs = [
    'jquery',
]

mix
    .setPublicPath('./')
    .sass('src/scss/base.scss', 'assets/css').options(scssOptions)
    // Extract libraries requires ECMAScript 6 imports in your code.
    // .js(bundles.all, 'assets/js/app.js').extract(extractLibs)
    .js(bundles.all, 'assets/js/app.js')
    .version()
Example #16
0
const mix = require('laravel-mix');
const path = require('path');
require('./config/build/sync-component');

// Base paths
const srcPath = 'src';
const publicPath = 'dist/public_html';
const distPath = path.join(publicPath, 'assets');

// Mix configuration
mix
  .setPublicPath(distPath)
  .setResourceRoot('/assets/')
  .sourceMaps(true, 'source-map')
  .version()
  .browserSync({
    proxy: 'localhost',
    files: ['dist/templates/**/*', path.join(distPath, 'styles/*.css')],
    open: false,
    xip: true,
    reloadOnRestart: false,
  });

// Replace default image loader
Mix.listen('configReady', require('./config/build/image-loader'));

// Build everything
mix
  .js(path.join(srcPath, 'scripts/initial.js'), 'scripts')
  .js(path.join(srcPath, 'scripts/main.js'), 'scripts')
  .js(path.join(srcPath, 'scripts/directory.js'), 'scripts')