mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Use webpack to build files and webpack-dev-server for testing (#1068)
* Create a separate entry point for webpack
Created a webpack entry point for KaTeX, which imports katex.less. As
flow[1] and jest[2] doesn't support CSS modules natively, a separate
entry point is used and it is not flowtyped.
[1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
[2] https://facebook.github.io/jest/docs/en/webpack.html
* Use webpack to build files
* Made webpack.config.js export valid webpack configuration
* Use:
browserify -> webpack
babelify -> babel-loader
UglifyJS CLI -> UglifyJsPlugin
Less CLI -> less-loader
cleancss -> cssnano in css-loader
build/fonts -> file-loader
* Inline CSS(Less) using style-loader and export them using
ExtractTextPlugin
* Add `watch` npm script calling `webpack --watch`
* Improve local testing(webpack-dev-server)
* Made webpackDevServer export a valid webpack configuration
* Compile Less and inline CSS using less-loader and style-loader
* Instead of copying files serve files from /static and use file-loader
* Remove old server.js and its dependencies
* Use webpack-dev-server in Screenshotter
* Include contrib in webpack-dev-server
+ Moved common configurations to webpack.common.js
* Rename webpackDevServer.js to webpack.dev...
to be consistent, avoid confusion with webpack-dev-server and follow
webpack configuration naming convention.
* Remove unnecessary conditional output.path
* Use map instead of reduce
+ Add comments regarding function arguments
* Remove unnecessary mkdir and clean build/* before build
* Use katex as external dependency instead of global variable in contrib
Fixes #692.
* Unblock codes as they are built as a module
* Update package-lock.json
* Add comments regarding devServer option
* Lint renamed webpack.dev.js
a0d8b33
* Export ES6 module and expose its default export
* Revert "Browserify hotfix (#1057)"
This reverts commit f6b509123b
.
* Enables colors on the console when running the dev server in Screenshotter
* Add context to webpack configuration
Allows webpack to be run from other directories
* Move `rm -rf build/*` to npm scripts
* Check dependencies before build
* Move UglifyJsPlugin into config creation
* Let webpack handle ES6 modules
Do not transform modules to commonjs in Babel. However Jest doesn't not
support ES6 modules, so transfrom modules to commonjs when NODE_ENV is
`test`.
* Add documentation on testing in IE 9 and 10 using webpack-dev-server
Changed version range to include IE-compatible version
This commit is contained in:
committed by
Kevin Barabash
parent
4a11c3166d
commit
5f32b71c85
26
package.json
26
package.json
@@ -3,7 +3,6 @@
|
||||
"version": "0.10.0-pre",
|
||||
"description": "Fast math typesetting for the web.",
|
||||
"main": "dist/katex.js",
|
||||
"browser": "dist/katex.min.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Khan/KaTeX.git"
|
||||
@@ -25,23 +24,20 @@
|
||||
"babel-preset-es2015": "^6.18.0",
|
||||
"babel-preset-flow": "^6.23.0",
|
||||
"babel-register": "^6.26.0",
|
||||
"babelify": "^7.3.0",
|
||||
"browserify": "^13.3.0",
|
||||
"check-dependencies": "^1.1.0",
|
||||
"clean-css": "^3.4.23",
|
||||
"css-loader": "^0.28.8",
|
||||
"eslint": "^4.14.0",
|
||||
"eslint-plugin-flowtype": "^2.40.1",
|
||||
"express": "^4.14.0",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^1.1.6",
|
||||
"flow-bin": "^0.62.0",
|
||||
"glob": "^7.1.1",
|
||||
"jest": "^22.0.4",
|
||||
"jest-serializer-html": "^4.0.1",
|
||||
"js-yaml": "^3.3.1",
|
||||
"json-stable-stringify": "^1.0.1",
|
||||
"jspngopt": "^0.2.0",
|
||||
"less": "~2.7.1",
|
||||
"less-plugin-clean-css": "^1.5.1",
|
||||
"morgan": "^1.7.0",
|
||||
"less-loader": "^4.0.5",
|
||||
"nomnom": "^1.8.1",
|
||||
"object-assign": "^4.1.0",
|
||||
"pako": "1.0.4",
|
||||
@@ -49,26 +45,26 @@
|
||||
"rimraf": "^2.6.2",
|
||||
"selenium-webdriver": "^2.48.2",
|
||||
"sri-toolbox": "^0.2.0",
|
||||
"style-loader": "^0.19.1",
|
||||
"stylelint": "^8.4.0",
|
||||
"stylelint-config-standard": "^18.0.0",
|
||||
"uglify-js": "~2.7.5",
|
||||
"uglifyjs-webpack-plugin": "^1.1.6",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-dev-server": "^2.8.2"
|
||||
"webpack-dev-server": "^2.7.1"
|
||||
},
|
||||
"bin": "cli.js",
|
||||
"scripts": {
|
||||
"lint": "eslint katex.js server.js cli.js webpack.config.js webpackDevServer.js src test contrib dockers && stylelint static/fonts.less static/katex.less",
|
||||
"lint": "eslint katex.js katex.webpack.js cli.js webpack.common.js webpack.config.js webpack.dev.js src test contrib dockers && stylelint static/fonts.less static/katex.less",
|
||||
"flow": "flow",
|
||||
"jest": "jest",
|
||||
"jest-update": "jest --updateSnapshot",
|
||||
"coverage": "jest --coverage",
|
||||
"copy": "cp -a static/. build/ && cp -a contrib build/",
|
||||
"clean": "rm -rf build/* node_modules/",
|
||||
"clean-install": "npm run clean && npm i",
|
||||
"test": "check-dependencies && npm run lint && npm run flow && npm run jest",
|
||||
"build-css": "lessc --clean-css static/katex.less build/katex.css",
|
||||
"prestart": "rimraf build && npm run build-css && npm run copy",
|
||||
"start": "check-dependencies && node webpackDevServer.js",
|
||||
"start": "check-dependencies && webpack-dev-server --open --config webpack.dev.js",
|
||||
"build": "check-dependencies && rimraf build/* && webpack",
|
||||
"watch": "npm run build -- --watch",
|
||||
"prepublishOnly": "make NIS= dist"
|
||||
},
|
||||
"pre-commit": [
|
||||
|
Reference in New Issue
Block a user