How to store multiple applications into one project


#1

Hi.
With previous version of vuecli, i could store two applications into a project.

module.exports = {

entry: {

docs: './src/docs.js',

['vue-katana']: './src/lib.js'

},

}

How can i do the same thing with vuecli3 ?

Thanks


#2

Hi
Two create 2 apps within one project, make below changes in vue.config.js file.

module.exports = {
  chainWebpack: config => {
    // delete default entry point 'app'
    config.entryPoints.delete("app").end();
    //delete default 'html' plugin - in case you don't want default index.html file
    //delete 'prefetch' and 'preload' plugins which are dependent on 'html' plugin
    config.plugins
      .delete("html")
      .delete("prefetch")
      .delete("preload");
  },
 configureWebpack: {
    entry: {
      app1: "./src/app1/main.js",
      app2: "./src/app2/main.js"
    },
    output: {
      filename: "[name]/[name].bundle.js"
    },
    plugins: [
       new HtmlWebpackPlugin({
       template: "public/app1/index.html",
       filename: "app1/index.html",
       chunks: ["app1", "chunk-common", "chunk-vendors"]
      }),
      new HtmlWebpackPlugin({
       template: "public/app2/index.html",
       filename: "app2/index.html",
       chunks: ["app2", "chunk-common", "chunk-vendors"]
       })] 
   }
}

Hope this helps.


#3

hey @chandrunaik thank you, perhaps you have an example project with that implementation of 2 apps that you could share?