Commit Graph

9 Commits

Author SHA1 Message Date
Kevin Barabash
298b482c18 Bump master to v0.10.0-pre 2018-02-18 16:55:16 -05:00
Kevin Barabash
cf6743b2a8 Bump master to v0.10.0-pre 2018-01-28 23:41:01 -05:00
ylemkimon
5f32b71c85 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
2018-01-21 19:48:25 -05:00
Kevin Barabash
0599e09a2d Bump master to v0.10.0-pre 2018-01-14 17:39:59 -05:00
Kevin Barabash
2ca6c3c73b Bump master to v0.10.0-pre 2017-11-26 18:34:59 -05:00
Kevin Barabash
b4c5dfaf20 Bump master to v0.10.0-pre 2017-10-15 16:49:24 -04:00
Kevin Barabash
2e27d4248b Bump master to v0.10.0-pre 2017-10-05 11:40:49 -06:00
Ryan Randall
fbffdc5fc7 Webpack dev server (#902)
* Initial webpack config. Moving to ES6 modules. Some module cleanup.

* WIP

* WIP

* Removing commented out code.

* Removing old deps.

* Removing the build script (used for testing).

* Working tests.

* Switching to node api over cli.

* Updating per comments. Still need to fix server.js to properly run the selenium tests.

* Cleaning up the config.

* More cleanup.

* Bringing back server.js for selenium tests.

* Bringing back old dependencies.

* Adding back eslint rules for webpack config. Final cleanup for webpack config.

* Pointing to correct pre-existing module versions. Adding some extra logic to server.js to ensure it gets transpiled properly.

* Getting make build to work again. Updating package.json with some shortcut scripts.

* Resolving conflict.

* Reverting back to commonjs modules.

* Removing extra spaces in babelrc
2017-09-26 12:16:35 -06:00
Erik Demaine
e71c7d4b81 copy-tex contrib module (#813)
* copy-tex contrib module

* Factor out replacement code

* Fix lint

* Support for more browsers, in particular Firefox

* Use for loop instead of Array.forEach
* Use replaceChild if replaceWith is unavailable
* Browserify to remove let etc.

* Fix HTML handling, in particular for Edge

* Convert DocumentFragment to HTML directly (via children' outerHTML)
* Set HTML content *before* text content; Edge takes the last only

* Handle .katex-html and .katex-mathml separately

* Implement option 2: CSS user-select: all

Also fix auto-render.js build location

* Revise documentation according to @kevinbarabash's comments

* Split copy-tex.js into it + katex2tex.js

This supports re-use of code in a custom copy handler.

* Document custom copy handler

* Add missing file
2017-09-04 21:17:46 -04:00