Skip to content

Commit

Permalink
replace laravel-mix to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Dec 12, 2024
1 parent f01473a commit 85272d8
Show file tree
Hide file tree
Showing 12 changed files with 621 additions and 4,295 deletions.
18 changes: 18 additions & 0 deletions dist/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"resources/css/bootstrap5.css": {
"file": "bootstrap5.css",
"src": "resources/css/bootstrap5.css",
"isEntry": true
},
"resources/css/tailwind.css": {
"file": "tailwind.css",
"src": "resources/css/tailwind.css",
"isEntry": true
},
"resources/js/powergrid.js": {
"file": "powergrid.js",
"name": "powergrid",
"src": "resources/js/powergrid.js",
"isEntry": true
}
}
4 changes: 1 addition & 3 deletions dist/bootstrap5.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions dist/mix-manifest.json

This file was deleted.

25 changes: 23 additions & 2 deletions dist/powergrid.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions dist/tailwind.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"test": "tests"
},
"scripts": {
"dev": "mix watch",
"build": "mix --production",
"build": "vite build",
"dev": "vite build --watch",
"blade-formatter": "blade-formatter --write resources/**/*.blade.php"
},
"repository": {
Expand All @@ -22,19 +22,19 @@
},
"homepage": "https://github.com/Power-Components/livewire-powergrid#readme",
"dependencies": {
"alpinejs": "^3.14.1",
"laravel-mix": "^6.0.49",
"tom-select": "^2.3.1"
"alpinejs": "^3.14.7",
"tom-select": "^2.4.1",
"vite": "^6.0.3"
},
"devDependencies": {
"autoprefixer": "^10.4.20",
"blade-formatter": "^1.41.1",
"cypress": "^13.13.2",
"cypress": "^13.16.1",
"flatpickr": "^4.6.13",
"postcss": "^8.4.41",
"postcss": "^8.4.49",
"resolve-url-loader": "^5.0.0",
"sass": "^1.77.8",
"sass-loader": "^14.1.1",
"tailwindcss": "^3.4.7"
"sass": "^1.82.0",
"sass-loader": "^16.0.4",
"tailwindcss": "^3.4.16"
}
}
File renamed without changes.
10 changes: 8 additions & 2 deletions resources/js/components/pg-flatpickr.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ Failed to mount filter: Filter::datetime('${this.dataField}') on table ['${this.

const lang = this.locale.locale;

if (typeof lang !== 'undefined' && typeof flatpickr != "undefined") {
this.locale.locale = require("flatpickr/dist/l10n/"+lang+".js").default[lang];
if (typeof lang !== 'undefined' && typeof flatpickr !== 'undefined') {
import(`flatpickr/dist/l10n/${lang}.js`)
.then(module => {
this.locale.locale = module.default[lang];
})
.catch(err => {
console.error("flatpickr l10n error", err);
});
}

const options = this.getOptions()
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const colors = require('tailwindcss/colors')
import colors from 'tailwindcss/colors'

module.exports = {
export default {
content: ["./resources/**/*.{html,js}"],
theme: {
extend: {
Expand Down
19 changes: 19 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('vite').UserConfig} */
export default {
build: {
assetsDir: '',
manifest: true,
rollupOptions: {
input: [
'resources/js/powergrid.js',
'resources/css/tailwind.css',
'resources/css/bootstrap5.css'
],
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
},
},
},
};
Loading

0 comments on commit 85272d8

Please sign in to comment.