Inline version using babel-plugin-version-inline (#1475)

* Inline version using `babel-plugin-version-inline`

* Fix `unicodeSymbols.js` generation
This commit is contained in:
ylemkimon
2018-07-16 03:41:03 +09:00
committed by GitHub
parent 9783ac1466
commit 48e9058a06
4 changed files with 12 additions and 4 deletions

View File

@@ -7,7 +7,8 @@
],
"plugins": [
"transform-runtime",
"transform-class-properties"
"transform-class-properties",
"version-inline"
],
"env": {
"test": {

View File

@@ -24,7 +24,7 @@ import {defineSymbol} from './src/symbols';
import {defineMacro} from './src/macros';
import {setFontMetrics} from './src/fontMetrics';
import {version} from "./package.json";
declare var __VERSION__: string;
/**
* Parse and build an expression, and place that expression in the DOM node
@@ -134,7 +134,7 @@ export default {
/**
* Current KaTeX version
*/
version,
version: __VERSION__,
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
* it as a child to the specified DOM node.

6
package-lock.json generated
View File

@@ -1273,6 +1273,12 @@
"babel-types": "^6.24.1"
}
},
"babel-plugin-version-inline": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/babel-plugin-version-inline/-/babel-plugin-version-inline-1.0.0.tgz",
"integrity": "sha1-uZtvkl20pMZ4nrCINuZtEo3VmT8=",
"dev": true
},
"babel-preset-es2015": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",

View File

@@ -21,6 +21,7 @@
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.23.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-plugin-version-inline": "^1.0.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-flow": "^6.23.0",
"babel-register": "^6.26.0",
@@ -69,7 +70,7 @@
"test:perf": "npm run prestart && NODE_ENV=test node test/perf-test.js",
"clean": "rm -rf build/* node_modules/",
"clean-install": "npm run clean && npm i",
"prestart": "node check-node-version.js && check-dependencies && cd src && node unicodeMake.js >unicodeSymbols.js",
"prestart": "node check-node-version.js && check-dependencies && node src/unicodeMake.js > src/unicodeSymbols.js",
"start": "webpack-dev-server --hot --config webpack.dev.js",
"analyze": "webpack --config webpack.analyze.js",
"build": "npm run prestart && rimraf build/* && webpack",