Skip to content

Commit

Permalink
Fix grunt build:esm -- missing src directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfe committed Feb 20, 2022
1 parent 91a6714 commit ae783ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const BASE_DIR = __dirname;
const BUILD_DIR = path.join(BASE_DIR, 'build');
const BUILD_CJS_DIR = path.join(BUILD_DIR, 'cjs');
const BUILD_ESM_DIR = path.join(BUILD_DIR, 'esm');
const BUILD_ESM_SRC_DIR = path.join(BUILD_ESM_DIR, 'src');
const BUILD_IMAGES_CURRENT_DIR = path.join(BUILD_DIR, 'images', 'current');
const BUILD_IMAGES_REFERENCE_DIR = path.join(BUILD_DIR, 'images', 'reference');
const REFERENCE_DIR = path.join(BASE_DIR, 'reference');
Expand Down Expand Up @@ -478,7 +479,7 @@ module.exports = (grunt) => {
}

log('ESM: Building to ./build/esm/');
fs.mkdirSync(BUILD_ESM_DIR, { recursive: true });
fs.mkdirSync(BUILD_ESM_SRC_DIR, { recursive: true });
// The build/esm/ folder needs a package.json that specifies { "type": "module" }.
// This indicates that all *.js files in `vexflow/build/esm/` are ES modules.
fs.writeFileSync(BUILD_ESM_PACKAGE_JSON_FILE, '{\n "type": "module"\n}\n');
Expand Down
2 changes: 2 additions & 0 deletions tools/version_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ module.exports = {
const V = `export const VERSION = '${VEXFLOW_VERSION}';`;
const I = `export const ID = '${GIT_COMMIT_ID}';`;
const D = `export const DATE = '${DATE}';`;

console.log(`Writing ESM version data to ${outputFile}`);
fs.writeFileSync(outputFile, `${V}\n${I}\n${D}`);
},

Expand Down

0 comments on commit ae783ac

Please sign in to comment.