mirror of
https://github.com/facebook/react.git
synced 2026-02-26 00:15:01 +00:00
37 lines
903 B
JavaScript
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'))),
|
|
},
|
|
],
|
|
},
|
|
};
|