Sha256: 55401ddad8e14580ceb5668bb74aa2979e95a970f8c821238da29c9ede69ed98

Contents?: true

Size: 1.27 KB

Versions: 11

Compression:

Stored size: 1.27 KB

Contents

/* eslint comma-dangle: ["error",
 {"functions": "never", "arrays": "only-multiline", "objects":
 "only-multiline"} ] */

const webpack = require('webpack');
const pathLib = require('path');

const devBuild = process.env.NODE_ENV !== 'production';

const config = {
  entry: [
    'es5-shim/es5-shim',
    'es5-shim/es5-sham',
    'babel-polyfill',
    './app/bundles/HelloWorld/startup/registration',
  ],

  output: {
    filename: 'webpack-bundle.js',
    path: pathLib.resolve(__dirname, '../app/assets/webpack'),
  },

  resolve: {
    extensions: ['.js', '.jsx'],
  },
  plugins: [
    new webpack.EnvironmentPlugin({ NODE_ENV: 'development' }),
  ],
  module: {
    rules: [
      {
        test: require.resolve('react'),
        use: {
          loader: 'imports-loader',
          options: {
            shim: 'es5-shim/es5-shim',
            sham: 'es5-shim/es5-sham',
          }
        },
      },
      {
        test: /\.jsx?$/,
        use: 'babel-loader',
        exclude: /node_modules/,
      },
    ],
  },
};

module.exports = config;

if (devBuild) {
  console.log('Webpack dev build for Rails'); // eslint-disable-line no-console
  module.exports.devtool = 'eval-source-map';
} else {
  console.log('Webpack production build for Rails'); // eslint-disable-line no-console
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
react_on_rails-7.0.4 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-7.0.3 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-7.0.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-7.0.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.10.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.10.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.9.3 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.9.2 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.9.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.9.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.8.2 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js