Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7fbbe26
fix(deps): update eslint (#351)
renovate[bot] May 4, 2023
66d1f43
fix(deps): update dependency @svgr/webpack to v7 (#340)
renovate[bot] May 4, 2023
7cbdcaa
chore(deps): update dependency typescript to v5 (#338)
renovate[bot] May 5, 2023
2040f67
fix: updated jest to resolve word-wrap ReDoS vulnerability (#411)
BilalQamar95 Jul 11, 2023
e56ef6e
feat: add fedx-scripts serve (#404)
adamstankiewicz Jul 18, 2023
4e456e3
fix(deps): update dependency sharp to v0.32.3
renovate[bot] Jul 18, 2023
dd0a21f
fix: reverted jest upgrade (#427)
BilalQamar95 Jul 25, 2023
5e9de99
fix(deps): update dependency sass to v1.65.1 (#426)
renovate[bot] Aug 15, 2023
e8136dc
fix(deps): update dependency postcss-custom-media to v10 (#407)
renovate[bot] Aug 15, 2023
26c67bb
chore(deps): update dependency @types/react to v17.0.64
renovate[bot] Aug 15, 2023
b3f6406
fix(deps): update dependency @pmmmwh/react-refresh-webpack-plugin to …
renovate[bot] Aug 15, 2023
8dec2ba
fix(deps): update dependency autoprefixer to v10.4.15
renovate[bot] Aug 15, 2023
5e1f332
fix(deps): update dependency postcss to v8.4.27
renovate[bot] Aug 15, 2023
b351065
fix(deps): update dependency postcss-rtlcss to v4.0.7
renovate[bot] Aug 15, 2023
6986459
fix(deps): update dependency sharp to v0.32.4
renovate[bot] Aug 15, 2023
04068a7
fix(deps): update dependency postcss to v8.4.28
renovate[bot] Aug 15, 2023
edb8de8
fix(deps): update dependency sharp to v0.32.5
renovate[bot] Aug 16, 2023
4b0b1fb
feat: Re-enable typescript for production builds
marlonkeating Apr 14, 2023
0020ea0
fix: updated jest to resolve word-wrap ReDoS vulnerability (#411)
BilalQamar95 Jul 11, 2023
3926fa2
fix(deps): update dependency sharp to v0.32.2
renovate[bot] Jul 11, 2023
5a61aa6
feat: add fedx-scripts serve (#404)
adamstankiewicz Jul 18, 2023
5bf2fa2
fix: reverted jest upgrade (#427)
BilalQamar95 Jul 25, 2023
c2aaff8
feat: Re-enable typescript for production builds
marlonkeating Apr 14, 2023
9ea50a6
fix: install ts-jest as dev dependency to ensure winds up in consumin…
muselesscreator Aug 7, 2023
4c98ab5
fix: make ts-jest a dependency to try and ensure it makes it to consu…
muselesscreator Aug 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ You may create a `.env.private` with any overrides of the environment settings c

**Note: .env.private should be added to your project's .gitignore so it does not get checked in.**

Serving a production Webpack build locally
------------------------------------------

In some scenarios, you may want to run a production Webpack build locally. To serve a production build locally:

#. Create an ``env.config.js`` file containing the configuration for local development, with the exception of ``NODE_ENV='production'``.
#. Run ``npm run build`` to build the production assets. The output assets will rely on the local development configuration specified in the prior step.
#. Add an NPM script ``serve`` to your application's ``package.json`` (i.e., ``"serve": "fedx-scripts serve"``).
#. Run ``npm run serve`` to serve your production build assets. It will attempt to run the build on the same port specified in the ``env.config.js`` file.

Local module configuration for TypeScript
-----------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const fs = require('fs');
const { defaults: tsjPreset } = require('ts-jest/presets');
const { jsWithTs: tsjPreset } = require('ts-jest/presets');

const presets = require('../lib/presets');

Expand Down
10 changes: 4 additions & 6 deletions lib/scripts/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ if (isDirectoryEmpty(buildPath)) {
console.log(chalk.bold.red(`ERROR: No build found. Please run ${formattedBuildCmd} first.`));
} else {
let configuredPort;
let envConfig;

try {
configuredPort = require(path.join(process.cwd(), 'env.config.js'))?.PORT;
envConfig = require(path.join(process.cwd(), 'env.config.js'));
configuredPort = envConfig?.PORT || process.env.PORT;
} catch (error) {
// Pass. Consuming applications may not have an `env.config.js` file. This is OK.
}

if (!configuredPort) {
configuredPort = process.env.PORT;
// pass, consuming applications may not have an `env.config.js` file. This is OK.
}

// No `PORT` found in `env.config.js` and/or `.env.development|private`, so output a warning.
Expand Down
Loading