Sha256: 09e018ebab2df9b5857cbd58c1aedac0c6c982e5b9bb9350cde151560bcac8ef

Contents?: true

Size: 1.45 KB

Versions: 16

Compression:

Stored size: 1.45 KB

Contents

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

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

const devBuild = process.env.NODE_ENV !== 'production';
const nodeEnv = devBuild ? 'development' : '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: '../app/assets/webpack',
  },

  resolve: {
    extensions: ['', '.js', '.jsx'],
    alias: {
      react: path.resolve('./node_modules/react'),
      'react-dom': path.resolve('./node_modules/react-dom'),
    },
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(nodeEnv),
      },
    }),
  ],
  module: {
    loaders: [
      {
        test: require.resolve('react'),
        loader: 'imports?shim=es5-shim/es5-shim&sham=es5-shim/es5-sham',
      },
      {
        test: /\.jsx?$/,
        loader: '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 {
  config.plugins.push(
    new webpack.optimize.DedupePlugin()
  );
  console.log('Webpack production build for Rails'); // eslint-disable-line no-console
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
react_on_rails-6.7.2 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.7.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.6.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.6.0.alpha.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.5.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.5.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.4.2 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.5.0.beta.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.4.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.4.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.5 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.4 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.3 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.2 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.1 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
react_on_rails-6.3.0 lib/generators/react_on_rails/templates/base/base/client/webpack.config.js