How does VueCli3.0 build multiple pages?

only Vue has been used to develop a single page, which is realized by multi-routing. Want to know how VueCli3.0 implements multiple pages? Will the middle reference be packaged by webpack

Apr.08,2021

add vue.config.js to the root directory and write
module.exports = {

pages: {

    index: {
        // entry for the page
        entry: 'src/login/login.ts',
        // the source template
        // title: "Login page",
        template: 'src/login/login.html',
        // output as dist/index.html
        filename: 'index.html',
    },
    main: {
        entry: 'src/main.ts',
        // title: "main page",
        template: 'src/index.html',
        filename: 'main.html',
        chunks: ['app']
    }
}

}

modify the url, and the previous 2 by yourself. In version 9, multi-entry and multi-html pages are similar


just add a packaging entry in webpack. The packaging of webpack is packaged according to the reference relationship of the file. Once referenced, it will be packaged. You can write another entry and package configuration, and other configurations can be shared. look here


https://cli.vuejs.org/zh/conf.

Menu