Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Laravel Mix to Vite #132

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ bin/
lib/
lib64
pyvenv.cfg

/public/build
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"watch-production": "mix watch --production",
"watch-prod": "npm run watch-production",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
"watch-prod": "npm run dev-production",
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"autoprefixer": "^10.4.2",
"axios": "^1.7.4",
"bootstrap": "^4.5.3",
"jquery": "^3.5.1",
"laravel-mix": "^6.0.41",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"postcss": "^8.4.31",
"resolve-url-loader": "^5.0.0",
"sass": "^1.49.0",
"sass-loader": "^12.4.0",
"tailwindcss": "^3.0.15",
"vue": "^2.6.14",
"vue": "^2.7.0",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.14"
"vue-template-compiler": "^2.6.14",
"vite": "^3.0.2",
"laravel-vite-plugin": "^0.6.0",
"@vitejs/plugin-vue2": "^1.1.2"
},
"dependencies": {
"babel-helper-vue-jsx-merge-props": "^2.0.3",
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
2 changes: 1 addition & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/


require('./bootstrap');
import './bootstrap';

window.Vue = require('vue').default;
import { i18n } from "./plugins/i18n.js"; // translation
Expand Down
12 changes: 7 additions & 5 deletions resources/js/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
window._ = require('lodash');
import _ from 'lodash';
window._ = _;

/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
Expand All @@ -19,7 +20,8 @@ try {
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/

window.axios = require('axios');
import axios from 'axios';
window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

Expand Down Expand Up @@ -49,11 +51,11 @@ if (token) {

// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// key: import.meta.env.VITE_PUSHER_APP_KEY,
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
// encrypted: true
// });

// Polyfills

require('es6-object-assign/auto');
import 'es6-object-assign/auto';
2 changes: 1 addition & 1 deletion resources/js/components/SettingArray.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";
import draggable from 'vuedraggable'

export default {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingArraySubKeyed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingArraySubKeyed",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingBoolean.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingBoolean",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingColor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingColor",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingDirectory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingDirectory",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingEmail",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingExecutable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingExecutable",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingFloat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingFloat",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingGroupRoleMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";
import LibrenmsSelect from "./LibrenmsSelect.vue";

export default {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingInteger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingInteger",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingLdapGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingLdapGroups",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingMultiple",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingOxidizedMaps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingOxidizedMaps",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingPassword",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingSelect",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingSelectDynamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";
import LibrenmsSelect from "./LibrenmsSelect.vue";

export default {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingSnmp3auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingSnmp3auth",
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SettingText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import BaseSetting from "./BaseSetting";
import BaseSetting from "./BaseSetting.vue";

export default {
name: "SettingText",
Expand Down
23 changes: 23 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue2';

export default defineConfig({
plugins: [
laravel({
input: [
'resources/sass/app.scss',
'resources/js/app.js',
],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
],
});
22 changes: 0 additions & 22 deletions webpack.mix.js

This file was deleted.

Loading