hunk.code_window:           - user_id
             - id
             filter:
               user_id:
                 _eq: X-HASURA-USER-ID
           role: user
         table: todo
         update_permissions:
  
hunk.labels: keep keep keep keep keep replace replace keep
hunk.file_path: community/sample-apps/todo-auth0-jwt/hasura/migrations/1536761653464_init.up.yaml
hunk.type: replace
file: /* global __dirname, require, module*/
  
  const webpack = require('webpack');
  const path = require('path');
  const env = require('yargs').argv.env; // use --env with webpack 2
  const pkg = require('./package.json');
  
  let libraryName = pkg.name;
  
  let outputFile, mode;
  
  if (env === 'build') {
    mode = 'production';
    outputFile = libraryName + '.min.js';
  } else {
    mode = 'development';
    outputFile = libraryName + '.js';
  }
  
  const config = {
    mode: mode,
    entry: __dirname + '/src/index.js',
    devtool: 'inline-source-map',
    output: {
      path: __dirname + '/lib',
      filename: outputFile,
      library: libraryName,
      libraryTarget: 'umd',
      umdNamedDefine: true,
      globalObject: "typeof self !== 'undefined' ? self : this"
    },
    module: {
      rules: [
        {
          test: /(\.jsx|\.js)$/,
          loader: 'babel-loader',
          exclude: /(node_modules|bower_components)/
        },
        /*
        {
          test: /(\.jsx|\.js)$/,
          loader: 'eslint-loader',
          exclude: /node_modules/
        }
        */
      ]
    },
    resolve: {
      modules: [path.resolve('./node_modules'), path.resolve('./src')],
      extensions: ['.json', '.js']
    },
    externals: {
      react: 'react',
      'react-dom': 'react-dom',
      'react-admin': 'react-admin',
      '@material-ui': '@material-ui'
    }
  };
  
  module.exports = config;
  