chore(build): Write intermediate langfiles to build/msg

Write the results of create_messages.py to build/msg instead of
build/msg/js.
This commit is contained in:
Christopher Allen
2022-10-04 15:16:45 +01:00
parent 3c24eebc1f
commit c99385fc14
3 changed files with 5 additions and 5 deletions

View File

@@ -290,7 +290,7 @@ Object.defineProperties(WidgetDiv, {
// CJS or ES module there will not be a Blockly global variable
// created. This can cause problems because a very common way of
// loading translations is to use a <script> tag to load one of
// msg/js/*.js, which consists of lines like:
// the generated msg/*.js files, which consists of lines like:
//
// Blockly.Msg["ADD_COMMENT"] = "Add Comment";
// Blockly.Msg["CLEAN_UP"] = "Clean up Blocks";

View File

@@ -415,7 +415,7 @@ this removal!
*/
function buildLangfiles(done) {
// Create output directory.
const outputDir = path.join(BUILD_DIR, 'msg', 'js');
const outputDir = path.join(BUILD_DIR, 'msg');
fs.mkdirSync(outputDir, {recursive: true});
// Run create_messages.py.
@@ -714,7 +714,7 @@ function checkinBuilt() {
return gulp.src([
`${RELEASE_DIR}/*_compressed.js`,
`${RELEASE_DIR}/*_compressed.js.map`,
// `${BUILD_DIR}/msg/js/*.js`, // Temporarily disabled (base mismatch).
// `${BUILD_DIR}/msg/*.js`, // Temporarily disabled (base mismatch).
], {base: RELEASE_DIR}).pipe(gulp.dest('.'));
}

View File

@@ -272,12 +272,12 @@ function packagePHP() {
};
/**
* This task wraps each of the ${BUILD_DIR}/msg/js/* files into a UMD module.
* This task wraps each of the files in ${BUILD_DIR/msg/ into a UMD module.
* @example import * as En from 'blockly/msg/en';
*/
function packageLocales() {
// Remove references to goog.provide and goog.require.
return gulp.src(`${BUILD_DIR}/msg/js/*.js`)
return gulp.src(`${BUILD_DIR}/msg/*.js`)
.pipe(gulp.replace(/goog\.[^\n]+/g, ''))
.pipe(packageUMD('Blockly.Msg', [], 'umd-msg.template'))
.pipe(gulp.dest(`${RELEASE_DIR}/msg`));