Skip to content

Instantly share code, notes, and snippets.

@fikrimastor
Last active February 24, 2025 20:27
Show Gist options
  • Save fikrimastor/93b7b803b2273cbaa6df4b315b890996 to your computer and use it in GitHub Desktop.
Save fikrimastor/93b7b803b2273cbaa6df4b315b890996 to your computer and use it in GitHub Desktop.
Laravel Vite Compile Tabler Theme Bootstrap 5
import '~tabler/dist/js/tabler.min.js';
import './bootstrap';
import '../sass/app.scss';
@import '~tabler/src/scss/tabler';
import loadash from 'lodash'
window._ = loadash
import * as Popper from '@popperjs/core'
window.Popper = Popper
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
import axios from 'axios'
window.axios = axios
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo';
// window.Pusher = require('pusher-js');
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// forceTLS: true
// });
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"axios": "^0.27",
"bootstrap": "^5.1.3",
"laravel-vite-plugin": "^0.5.0",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"sass": "^1.32.11",
"sass-loader": "^11.0.1",
"@tabler/core": "^1.0.0-beta11",
"autosize": "^5.0.1",
"imask": "^6.4.2",
"resolve-url-loader": "^5.0.0",
"vite": "^3.0.0"
}
}
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import path from 'path'
export default defineConfig({
plugins: [
laravel({
input: [
'resources/js/app.js'
],
refresh: true,
}),
],
resolve: {
alias: {
'~tabler': path.resolve(__dirname, 'node_modules/@tabler/core'),
'~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
}
},
});
@Khant-Nyar
Copy link

any update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment