mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 11:13:26 +00:00
perf: 支持gitpod
This commit is contained in:
parent
d9c036e359
commit
6e51b7f300
13
.gitpod.yml
Normal file
13
.gitpod.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# This configuration file was automatically generated by Gitpod.
|
||||||
|
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
|
||||||
|
# and commit this file to your remote git repository to share the goodness with others.
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- init: sudo ./cmd install
|
||||||
|
command: ./cmd dev
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- port: 2222
|
||||||
|
visibility: public
|
||||||
|
- port: 22222
|
||||||
|
visibility: public
|
||||||
@ -136,7 +136,7 @@ services:
|
|||||||
|
|
||||||
drawio-export:
|
drawio-export:
|
||||||
container_name: "dootask-drawio-export-${APP_ID}"
|
container_name: "dootask-drawio-export-${APP_ID}"
|
||||||
image: "jgraph/export-server"
|
image: "kuaifan/export-server:latest"
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
networks:
|
networks:
|
||||||
extnetwork:
|
extnetwork:
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
"internal-ip": "^6.2.0",
|
"internal-ip": "^6.2.0",
|
||||||
"jquery": "^3.6.1",
|
"jquery": "^3.6.1",
|
||||||
"jspdf": "^2.5.1",
|
"jspdf": "^2.5.1",
|
||||||
"laravel-mix": "^6.0.49",
|
"laravel-mix": "git+https://github.com/kuaifan/laravel-mix.git#master",
|
||||||
"le5le-store": "^1.0.7",
|
"le5le-store": "^1.0.7",
|
||||||
"less": "^4.1.2",
|
"less": "^4.1.2",
|
||||||
"less-loader": "^10.2.0",
|
"less-loader": "^10.2.0",
|
||||||
|
|||||||
35
webpack.mix.js
vendored
35
webpack.mix.js
vendored
@ -1,8 +1,9 @@
|
|||||||
const mix = require('laravel-mix');
|
const mix = require('laravel-mix');
|
||||||
const ipv4 = require('internal-ip').v4.sync();
|
const ipv4 = require('internal-ip').v4.sync();
|
||||||
|
const execSync = require('child_process').execSync;
|
||||||
const argv = process.argv;
|
const argv = process.argv;
|
||||||
|
|
||||||
let mixBuildName = function (str) {
|
const mixBuildName = function (str) {
|
||||||
if (typeof str !== "string") {
|
if (typeof str !== "string") {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@ -12,9 +13,20 @@ let mixBuildName = function (str) {
|
|||||||
return str.replace(/_/g, '/');
|
return str.replace(/_/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
let isHot = argv.includes('--hot');
|
const hmrPublicURL = function (port) {
|
||||||
let isElectron = argv.includes('--electron');
|
try {
|
||||||
let publicPath = (!isHot && isElectron) ? 'electron/public' : 'public';
|
return execSync('gp url ' + port).toString().trim()
|
||||||
|
} catch (e) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const devPort = 22222
|
||||||
|
const publicURL = hmrPublicURL(devPort)
|
||||||
|
|
||||||
|
const isHot = argv.includes('--hot');
|
||||||
|
const isElectron = argv.includes('--electron');
|
||||||
|
const publicPath = (!isHot && isElectron) ? 'electron/public' : 'public';
|
||||||
|
|
||||||
mix
|
mix
|
||||||
.copy('resources/assets/statics/public', publicPath)
|
.copy('resources/assets/statics/public', publicPath)
|
||||||
@ -27,10 +39,16 @@ mix
|
|||||||
chunkFilename: ({chunk}) => {
|
chunkFilename: ({chunk}) => {
|
||||||
return `js/build/${mixBuildName(chunk.id)}.js`
|
return `js/build/${mixBuildName(chunk.id)}.js`
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
if (isElectron && !isHot) {
|
if (isHot) {
|
||||||
config.output.publicPath = './'
|
if (publicURL) {
|
||||||
|
config.output.publicPath = publicURL + '/'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isElectron) {
|
||||||
|
config.output.publicPath = './'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
})
|
})
|
||||||
@ -38,7 +56,8 @@ mix
|
|||||||
processCssUrls: false,
|
processCssUrls: false,
|
||||||
hmrOptions: {
|
hmrOptions: {
|
||||||
host: ipv4 || 'localhost',
|
host: ipv4 || 'localhost',
|
||||||
port: '22222'
|
port: devPort,
|
||||||
|
publicURL
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.vue({
|
.vue({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user