Skip to content

Commit 2d87a89

Browse files
committed
fixed - env variables
1 parent a5bdd32 commit 2d87a89

File tree

8 files changed

+288
-286
lines changed

8 files changed

+288
-286
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VUE_APP_LFM_AXIOS_BASE_URL=
2-
VUE_APP_LFM_CSRF_TOKEN=
1+
VITE_APP_LFM_AXIOS_BASE_URL=
2+
VITE_APP_LFM_CSRF_TOKEN=

.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VUE_APP_LFM_AXIOS_BASE_URL=http://lfm.loc/file-manager/
2-
VUE_APP_LFM_CSRF_TOKEN=OFF
1+
VITE_APP_LFM_AXIOS_BASE_URL=http://lfm.loc/file-manager/
2+
VITE_APP_LFM_CSRF_TOKEN=OFF

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ Don't forget to add a csrf token to head block in your Laravel view and add boot
115115
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
116116
```
117117

118-
[Laravel mix environment variables](https://laravel.com/docs/mix#environment-variables)
118+
[Laravel VITE environment variables](https://laravel.com/docs/9.x/vite#environment-variables)
119119
```
120120
// set baseUrl
121-
MIX_LFM_BASE_URL=http://my-url.loc/file-manager/
121+
VITE_LFM_BASE_URL=http://my-url.loc/file-manager/
122122
123123
// if you don't want to use csrf-token - you can off it
124-
MIX_LFM_CSRF_TOKEN=OFF
124+
VITE_LFM_CSRF_TOKEN=OFF
125125
```

package-lock.json

Lines changed: 269 additions & 265 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-file-manager",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "File manager for Laravel",
55
"keywords": [
66
"laravel",
@@ -19,24 +19,23 @@
1919
"dependencies": {
2020
"axios": "^0.25.0",
2121
"codemirror": "^5.65.1",
22-
"codemirror-editor-vue3": "^1.0.1",
22+
"codemirror-editor-vue3": "^2.1.7",
2323
"cropperjs": "^1.5.12",
2424
"mitt": "^3.0.0",
2525
"plyr": "^3.6.12",
2626
"vue": "^3.2.25",
2727
"vuex": "^4.0.2"
2828
},
2929
"devDependencies": {
30-
"@vitejs/plugin-vue": "^2.0.0",
30+
"@vitejs/plugin-vue": "^3.0.0",
3131
"eslint": "^8.8.0",
3232
"eslint-config-airbnb-base": "^15.0.0",
3333
"eslint-config-prettier": "^8.3.0",
3434
"eslint-plugin-import": "^2.25.4",
3535
"eslint-plugin-prettier": "^4.0.0",
36-
"eslint-plugin-vue": "^8.4.0",
36+
"eslint-plugin-vue": "^9.2.0",
3737
"prettier": "^2.5.1",
3838
"sass": "^1.49.7",
39-
"vite": "^2.7.2",
40-
"vite-plugin-environment": "^1.1.0"
39+
"vite": "^3.0.0"
4140
}
4241
}

src/store/settings/mutations.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ export default {
3434
initAxiosSettings(state) {
3535
// initiate base url, if not set manually
3636
if (!state.baseUrl) {
37-
if (process.env.VUE_APP_LFM_AXIOS_BASE_URL) {
37+
if (import.meta.env.VITE_APP_LFM_AXIOS_BASE_URL) {
3838
// vue .env
39-
state.baseUrl = process.env.VUE_APP_LFM_AXIOS_BASE_URL;
40-
} else if (process.env.MIX_LFM_BASE_URL) {
39+
state.baseUrl = import.meta.env.VITE_APP_LFM_AXIOS_BASE_URL;
40+
} else if (import.meta.env.VITE_LFM_BASE_URL) {
4141
// laravel .env
42-
state.baseUrl = process.env.MIX_LFM_BASE_URL;
42+
state.baseUrl = import.meta.env.VITE_LFM_BASE_URL;
4343
} else {
4444
let baseUrl = `${window.location.protocol}//${window.location.hostname}`;
4545

@@ -56,7 +56,7 @@ export default {
5656
// initiate headers, if not set manually
5757
if (Object.keys(state.headers).length === 0) {
5858
// off laravel csrf-token if need
59-
if (process.env.VUE_APP_LFM_CSRF_TOKEN === 'OFF' || process.env.MIX_LFM_CSRF_TOKEN === 'OFF') {
59+
if (import.meta.env.VITE_APP_LFM_CSRF_TOKEN === 'OFF' || import.meta.env.VITE_LFM_CSRF_TOKEN === 'OFF') {
6060
state.headers = { 'X-Requested-With': 'XMLHttpRequest' };
6161
} else {
6262
// Laravel CSRF token

src/store/settings/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
acl: null,
3030

3131
// App version
32-
version: '3.0.2',
32+
version: '3.0.3',
3333

3434
// axios headers
3535
headers: {},

vite.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { defineConfig } from 'vite';
22
import vue from '@vitejs/plugin-vue';
3-
import EnvironmentPlugin from 'vite-plugin-environment';
43

54
// https://vitejs.dev/config/
65
export default defineConfig({
7-
plugins: [vue(), EnvironmentPlugin(['VUE_APP_LFM_AXIOS_BASE_URL', 'VUE_APP_LFM_CSRF_TOKEN'])],
6+
plugins: [vue()],
87
build: {
98
minify: true,
109
cssCodeSplit: false,

0 commit comments

Comments
 (0)