async server(internalBuildConfig = {}) {
        /* eslint-disable fecs-one-var-per-line */
        let {extend, extendWithWebpackChain, nodeExternalsWhitelist = [],
            babel,
            defines: {server: serverDefines = {}},
            alias: {server: serverAlias = {}},
            plugins: {base: basePlugins = [], server: serverPlugins = []}
        } = Object.assign({}, this.config.build, internalBuildConfig);
        /* eslint-enable fecs-one-var-per-line */

        let serverConfig = await this.base(Object.assign(internalBuildConfig, {
            babelOptions: this.generateBabelOptions(babel, false)
        }));

        // set target & output
        serverConfig
            .target('node')
            .output
                .filename('server-bundle.js')
                .libraryTarget('commonjs2');

        // add alias for server
        Object.keys(serverAlias).forEach(aliasKey => {
            serverConfig.resolve.alias.set(aliasKey, serverAlias[aliasKey]);
        });

        /**
         * Generally in ssr, we don't need any loader to handle style files,
         * but some UI library such as vuetify will require style files directly in JS file.
         * So we still add some relative loaders here.
         */
        this.addStyleRules(serverConfig, {
            cssSourceMap: false,
            cssMinimize: false,
            cssExtract: false
        });

        // https://webpack.js.org/configuration/externals/#externals
        // https://github.com/liady/webpack-node-externals
        serverConfig.externals(nodeExternals({
            // do not externalize CSS files in case we need to import it from a dep
            whitelist: [...nodeExternalsWhitelist, /\.(css|vue)$/]
        }));

        // modify vars in DefinePlugin
        serverConfig.plugin('define').init((Plugin, args) =>
            new Plugin(Object.assign(args[0], {
                'process.env.VUE_ENV': '"server"',
                'process.env.NODE_ENV': `"${this.env}"`
            }, serverDefines)));

        // add vue-ssr-server-plugin
        serverConfig.plugin('ssr-server').use(VueSSRServerPlugin, [{
            filename: join(LAVAS_DIRNAME_IN_DIST, SERVER_BUNDLE)
        }]);

        // call extendWithWebpackChain function if provided
        let extendWithWebpackChainArray = [
            extendWithWebpackChain,
            this.config.build.extendWithWebpackChain
        ];
        for (let i = 0; i < extendWithWebpackChainArray.length; i++) {
            let extendFunc = extendWithWebpackChainArray[i];
            if (typeof extendFunc === 'function') {
                await extendFunc(serverConfig, {
                    type: 'server',
                    env: this.env
                });
            }
        }

        // convert webpackChain to plain webpack config object
        let webpackConfigObject = serverConfig.toConfig();

        // add plugins from `plugins` option
        if (basePlugins && basePlugins.length) {
            webpackConfigObject.plugins = [...webpackConfigObject.plugins, ...basePlugins];
        }
        if (serverPlugins && serverPlugins.length) {
            webpackConfigObject.plugins = [...webpackConfigObject.plugins, ...serverPlugins];
        }

        // call extend function if provided
        if (typeof extend === 'function') {
            extend.call(this, webpackConfigObject, {
                type: 'base',
                env: this.env
            });
            extend.call(this, webpackConfigObject, {
                type: 'server',
                env: this.env
            });
        }

        return webpackConfigObject;
    }
generate webpack server config based on lavas config

@param {Object} internalBuildConfig build config
@return {Object} webpack server config