Files
react/shells/browser/webpack.backend.js
Brian Vaughn 5e0dfdac54 Initial commit
2019-01-22 11:04:37 -08:00

37 lines
903 B
JavaScript

/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
const {readFileSync} = require('fs');
const {resolve} = require('path');
const __DEV__ = process.env.NODE_ENV !== 'production';
module.exports = {
mode: __DEV__ ? 'development' : 'production',
devtool: __DEV__ ? 'cheap-module-eval-source-map' : false,
entry: {
backend: './src/backend.js',
},
output: {
path: __dirname + '/build',
filename: '[name].js',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
options: JSON.parse(readFileSync(resolve(__dirname, '../../.babelrc'))),
},
],
},
};