Skip to content

How can I have a third parallel compilation for the WebSockets server? #1672

Answered by fivethreeo
silviubogan asked this question in Q&A
Discussion options

You must be logged in to vote
// razzle.config.js
'use strict';

const StartServerPlugin = require('razzle-start-server-webpack-plugin');

module.exports = {
    modifyWebpackConfig(opts) {
        const config = opts.webpackConfig;
        const options = opts.options.webpackOptions;

        if (opts.env.target === 'node') {
            config.entry.wsserver = ['./src/server/ws.tsx'];

            if (opts.env.dev) {
                config.entry.wsserver.unshift(
                  `${require.resolve('webpack/hot/poll')}?300`
                );
        
                // Pretty format server errors
                config.entry.wsserver.unshift(
                  require.resolve('razzle-dev-utils/prettyNodeErrors')

Replies: 5 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

@silviubogan
Comment options

@silviubogan
Comment options

Comment options

You must be logged in to vote
4 replies
@silviubogan
Comment options

@silviubogan
Comment options

@fivethreeo
Comment options

@silviubogan
Comment options

Answer selected by fivethreeo
Comment options

You must be logged in to vote
4 replies
@fivethreeo
Comment options

@silviubogan
Comment options

@silviubogan
Comment options

@silviubogan
Comment options

Comment options

You must be logged in to vote
3 replies
@silviubogan
Comment options

@silviubogan
Comment options

@fivethreeo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants