Skip to content

Commit

Permalink
feat: move mkdirp to beforeBuild so it doesnt get called twice
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Nov 6, 2020
1 parent 74951f5 commit 6255874
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/meta/build.js
Expand Up @@ -4,6 +4,8 @@ const os = require('os');
const winston = require('winston');
const nconf = require('nconf');
const _ = require('lodash');
const path = require('path');
const mkdirp = require('mkdirp');

const cacheBuster = require('./cacheBuster');
let meta;
Expand Down Expand Up @@ -83,6 +85,7 @@ async function beforeBuild(targets) {
await meta.themes.setupPaths();
const plugins = require('../plugins');
await plugins.prepareForBuild(targets);
await mkdirp(path.join(__dirname, '../../build/public'));
} catch (err) {
winston.error('[build] Encountered error preparing for build\n' + err.stack);
throw err;
Expand Down
1 change: 0 additions & 1 deletion src/meta/js.js
Expand Up @@ -336,7 +336,6 @@ JS.buildBundle = async function (target, fork) {
client: 'nodebb.min.js',
admin: 'acp.min.js',
};
await mkdirp(path.join(__dirname, '../../build/public'));
await requirejsOptimize(target);
const files = await getBundleScriptList(target);

Expand Down

0 comments on commit 6255874

Please sign in to comment.