I have the following vue.config.js:

module.exports = {
filenameHashing: false,
productionSourceMap: false,
outputDir: '../vuejs/',
configureWebpack: {
    devtool: 'source-map',
    output: {
        filename: '[name].js'
    }
},
pages: {
    feature1: {
        entry: 'src/f1.js',
        template: 'public/feature.html',
        filename: 'index1.html',
        title: 'Feature 1',
        chunks: ['chunk-vendors', 'chunk-common', 'feature1']
    },
    feature2: {
        entry: 'src/f2.js',
        template: 'public/feature.html',
        filename: 'index2.html',
        title: 'Feature 2',
        chunks: ['chunk-vendors', 'chunk-common', 'feature2']
    }
} 
}

On npm run build it generates:

index1.html 
index2.html 
feature1.js 
feature2.js 
js/chunk-vendors.js

in the dist folder (../vuejs/)

How could I change the configuration so the file chunk-vendors.js would be placed in the root folder (where feature1.js and feature2.js are).

P.S. : (Extra question) I actually do not need the html files, as I embed the vue.js *.js into an existing application. Can I suppress the generation of the html files?

0 Answers