I’m currently facing an issue with two similar projects I am working on. Both projects use the same base codes built upon the package/vueConfig files. However, when I build one of the projects, a number of js files are generated outside the designated js folder. This is a problem that I need to address and rectify.
https://i.sstatic.net/wgGMs.png
Despite looking into solutions such as this one and consulting the documentation, I am still encountering the same output.
Below is the script section of my package file:
"scripts": {
"serve:vlox": "env APP_TYPE=vloxEditor vue-cli-service serve vloxEditor/src/main.js",
"build:vlox": "env APP_TYPE=vloxEditor vue-cli-service build vloxEditor/src/main.js",
"serve:res": "env APP_TYPE=resourceEditor vue-cli-service serve resourceEditor/src/main.js",
"build:res": "env APP_TYPE=resourceEditor vue-cli-service build resourceEditor/src/main.js"
},
And here is the content of my vue.config file:
var fs = require('fs');
const path = require('path')
const appDir = process.env.APP_TYPE;
module.exports = {
outputDir: path.resolve(__dirname, `${appDir}/dist`),
publicPath: `./${appDir}-assets`,
chainWebpack: config => {
config.resolve.alias.set('@I', path.resolve(__dirname, '../interfaces'))
config.resolve.alias.set('@shared', path.resolve(__dirname, './shared'))
config.plugin("html").tap(args => {
args[0].template = path.resolve(__dirname, `${appDir}/index.html`)
return args
})
},
devServer: {
"port": 9090,
"https": {
"key": fs.readFileSync('../../vue-res/certs/ssl.key'),
"cert": fs.readFileSync('../../vue-res/certs/ssl.crt')
},
proxy: {
'^/vlox': {
target: 'https://172.25.37.144',
changeOrigin: true
},
}
}
}
The overall structure of my project looks like this: