-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd5f56e
commit ed6c00f
Showing
11 changed files
with
124 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REACT_APP_HOST=localhost | ||
REACT_APP_PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use-strict' | ||
|
||
const conf = { | ||
port: 8080, | ||
port_ssl: 443, | ||
host: '127.0.0.1' | ||
} | ||
|
||
module.exports = conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'use strict'; | ||
|
||
// Do this as the first thing so that any code reading it knows the right env. | ||
process.env.BABEL_ENV = 'production'; | ||
process.env.NODE_ENV = 'production'; | ||
|
||
const assetManifest = require('../build/client/asset-manifest.json'); | ||
if (!assetManifest) { | ||
console.log(chalk.red('No assets-manifest.json. Did you run the build-client script?.\n')); | ||
} | ||
process.env.REACT_APP_ASSET_MANIFEST = JSON.stringify(assetManifest); | ||
|
||
const path = require('path'); | ||
const chalk = require('chalk'); | ||
const fs = require('fs-extra'); | ||
const webpack = require('webpack'); | ||
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); | ||
const config = require('../config/webpack.config.server'); | ||
|
||
function build(previousFileSizes) { | ||
console.log('Creating an optimized production build...'); | ||
|
||
let compiler = webpack(config); | ||
return new Promise((resolve, reject) => { | ||
compiler.run((err, stats) => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
const messages = formatWebpackMessages(stats.toJson({}, true)); | ||
if (messages.errors.length) { | ||
return reject(new Error(messages.errors.join('\n\n'))); | ||
} | ||
if (process.env.CI && messages.warnings.length) { | ||
console.log( | ||
chalk.yellow( | ||
'\nTreating warnings as errors because process.env.CI = true.\n' + | ||
'Most CI servers set it automatically.\n' | ||
) | ||
); | ||
return reject(new Error(messages.warnings.join('\n\n'))); | ||
} | ||
return resolve({ | ||
stats, | ||
warnings: messages.warnings, | ||
}); | ||
}); | ||
}) | ||
} | ||
|
||
build() | ||
.then( ({ stats, previousFileSizes, warnings }) => { | ||
if (warnings.length) { | ||
console.log(chalk.yellow('Compiled with warnings.\n')); | ||
console.log(warnings.join('\n\n')); | ||
console.log( | ||
'\nSearch for the ' + | ||
chalk.underline(chalk.yellow('keywords')) + | ||
' to learn more about each warning.' | ||
); | ||
console.log( | ||
'To ignore, add ' + | ||
chalk.cyan('// eslint-disable-next-line') + | ||
' to the line before.\n' | ||
); | ||
} else { | ||
console.log(chalk.green('Compiled successfully.\n')); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters