Skip to content

Commit

Permalink
Merge pull request #353 from appsembler/john/fix-fe-asset-build
Browse files Browse the repository at this point in the history
Juniper Upgrade - Fix the front end asset build
  • Loading branch information
johnbaldwin authored May 30, 2021
2 parents 3cf20e6 + 48eff18 commit d3f5f4e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
6 changes: 5 additions & 1 deletion frontend/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);

const envPublicUrl = process.env.PUBLIC_URL;

// For managing multiple asset builds. Defaults to rb16
const appBuildDirectory = process.env.FIGURES_APP_BUILD || '../figures/static/figures/rb16';


function ensureSlash(path, needsSlash) {
const hasSlash = path.endsWith('/');
if (hasSlash && !needsSlash) {
Expand Down Expand Up @@ -41,7 +45,7 @@ function getServedPath(appPackageJson) {
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appBuild: resolveApp('../figures/static/figures'),
appBuild: resolveApp(appBuildDirectory),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
Expand Down
3 changes: 3 additions & 0 deletions frontend/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
: {};

// Default to the REM_BASE=16
// This needs to be a relative path. If it is an absolute path then the build
// creates the full path as a subdirectory of <figures-repo>/frontend directory
const figuresAppBuild = process.env.FIGURES_APP_BUILD || '../figures/static/figures/rb16';
const webpackStatsFile = figuresAppBuild + '/webpack-stats.json';


// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
// The development configuration is different and lives in a separate file.
Expand Down
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"multi-build": "node scripts/multi-build.js",
"build": "npm run build-rb10 && npm run build-rb16",
"build-rb10": "REM_BASE=10 FIGURES_APP_BUILD=../figures/static/figures/rb10 node scripts/build.js",
"build-rb16": "REM_BASE=16 FIGURES_APP_BUILD=../figures/static/figures/rb16 node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
"jest": {
Expand Down
12 changes: 0 additions & 12 deletions frontend/scripts/multi-build.js

This file was deleted.

0 comments on commit d3f5f4e

Please sign in to comment.