Problems and solutions encountered in the process of creating projects with webpack

1 webpack implements multiple input and output multiple html

entry:{
        main: './src/main.js',
        login: './src/login.js'
    },

plugins: [
        new HtmlWebpackPlugin({
            filename: 'index.html',
            template: './src/index.html',
            chunks: ['main'] //Insert main.js into index.html,
        }),

        new HtmlWebpackPlugin({
            filename: 'login.html',
            template: './src/login.html',
            chunks: ['login']
        })

    ],

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324820487&siteId=291194637