Make unicodeAccents.js ES6 module (#1477)

Use `babel-register` in `unicodeMake.js` to require ES6 module.
This commit is contained in:
ylemkimon
2018-07-16 02:54:54 +09:00
committed by Erik Demaine
parent b7277049a4
commit 9783ac1466
2 changed files with 3 additions and 5 deletions

View File

@@ -1,9 +1,6 @@
// Mapping of Unicode accent characters to their LaTeX equivalent in text and
// math mode (when they exist).
// NOTE: This module needs to be written with Node-style modules (not
// ES6 modules) so that unicodeMake.js (a Node application) can import it.
module.exports = {
export default {
'\u0301': {text: "\\'", math: '\\acute'},
'\u0300': {text: '\\`', math: '\\grave'},
'\u0308': {text: '\\"', math: '\\ddot'},

View File

@@ -5,7 +5,8 @@
// In this way, only this tool, and not the distribution/browser,
// needs String's normalize function.
const accents = require('./unicodeAccents');
require('babel-register')({plugins: ["transform-es2015-modules-commonjs"]});
const accents = require('./unicodeAccents').default;
console.log("// @flow");
console.log("// This file is GENERATED by unicodeMake.js. DO NOT MODIFY.");