November 2017
Beginner to intermediate
398 pages
8h 42m
English
Next to webpack/common.js, create a new server.js file that extends the base configuration:
const merge = require('webpack-merge')const common = require('./common')const nodeExternals = require('webpack-node-externals')const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')module.exports = merge(common, { entry: './src/entry-server', target: 'node', devtool: 'source-map', output: { libraryTarget: 'commonjs2', }, // Skip webpack processing on node_modules externals: nodeExternals({ // Force css files imported from no_modules // to be processed by webpack whitelist: /\.css$/, }), plugins: [ // Generates the server bundle file new VueSSRServerPlugin(), ],})
Here, we change multiple options, such as the
Read now
Unlock full access