Sha256: a31003bb90a6e6cd7fc96a087714c63991a5d7d4774a82a676b02cd6a2352b12

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

// Run like this:
// cd client && npm run build:dev
// Note that Foreman (Procfile.dev) has also been configured to take care of this.

// NOTE: All style sheets handled by the asset pipeline in rails

const webpack = require('webpack');
const config = require('./webpack.client.base.config');

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

config.output = {
  filename: '[name]-bundle.js',
  path: '../app/assets/javascripts/generated',
};

// You can add entry points specific to rails here
config.entry.vendor.unshift(
  'es5-shim/es5-shim',
  'es5-shim/es5-sham'
);

// See webpack.common.config for adding modules common to both the webpack dev server and rails

config.module.loaders.push(
  {test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
  {test: require.resolve('react'), loader: 'imports?shim=es5-shim/es5-shim&sham=es5-shim/es5-sham'}
);

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.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production'),
      },
    }),
    new webpack.optimize.DedupePlugin()
  );
  console.log('Webpack production build for Rails'); // eslint-disable-line no-console
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
react_on_rails-1.0.3 lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js
react_on_rails-1.0.2 lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js
react_on_rails-1.0.1 lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js
react_on_rails-1.0.0 lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js