Sha256: a6928b42861366b0280d847b7c72845686d6ea204b63556550803a61ca77eb8e

Contents?: true

Size: 989 Bytes

Versions: 4

Compression:

Stored size: 989 Bytes

Contents

<%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js") %>

process.env.NODE_ENV = process.env.NODE_ENV || 'development';

const { devServer, inliningCss } = require('@rails/webpacker');

const webpackConfig = require('./webpackConfig');

const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
  // plugins
  if (inliningCss) {
    // Note, when this is run, we're building the server and client bundles in separate processes.
    // Thus, this plugin is not applied to the server bundle.

    // eslint-disable-next-line global-require
    const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
    clientWebpackConfig.plugins.push(
      new ReactRefreshWebpackPlugin({
        overlay: {
          sockPort: devServer.port,
        },
      }),
    );
  }
};

module.exports = webpackConfig(developmentEnvOnly);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
react_on_rails-12.6.0 lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt
react_on_rails-12.5.2 lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt
react_on_rails-12.5.1 lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt
react_on_rails-12.5.0 lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt