This scaffold is built based on VueCli4, vue-cli-plugin-electronic-builder and @dvgis/dc-sdk, which is used to quickly build 3D desktop applications.
yarn run serve
yarn run electron:serve
yarn run build
yarn run electron:build
const dvgis = './node_modules/@dvgis'
module.exports = {
// Other configuration
chainWebpack: config => {
config.resolve.alias.set('dvgis', path.resolve(__dirname, dvgis))
config.plugin('copy').use(CopywebpackPlugin, [
[
{
from: path.join(__dirname, 'public'),
to: path.join(__dirname, 'dist'),
ignore: ['index.html']
},
{
from: path.join(dvgis, 'dc-sdk/dist/resources'),
to: path.join(__dirname, 'dist', 'libs/dc-sdk/resources')
}
]
])
},
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
let outputDir = 'dist_electron/bundled'
fs.removeSync(path.join(__dirname, outputDir, 'Assets'))
fs.removeSync(path.join(__dirname, outputDir, 'Widgets'))
fs.removeSync(path.join(__dirname, outputDir, 'Workers'))
fs.removeSync(path.join(__dirname, outputDir, 'ThirdParty'))
config.plugin('copy').use(CopywebpackPlugin, [
[
{
from: path.join(__dirname, 'public'),
to: path.join(__dirname, outputDir),
ignore: ['index.html']
},
{
from: path.join(dvgis, 'dc-sdk/dist/resources'),
to: path.join(__dirname, outputDir, 'libs/dc-sdk/resources')
}
]
])
},
chainWebpackRendererProcess: config => {
config.plugin('define').tap(args => {
const env = args[0]['process.env']
for (let key in env) {
args[0][`process.env.${key}`] = env[key]
}
delete args[0]['process.env']
return args
})
}
}
}
}
gets the value assigned by the corresponding configuration file
desktop: .dc-conf/config.json in the current user directory
Web side: the project directory public/config/config json