Commit Graph

9 Commits

Author SHA1 Message Date
ylemkimon
f628ca142b Generate ECMAScript module for contrib (#1624)
* Create separate entry point of copy-tex for webpack

* Update katex.webpack.js comment

* Generate ECMAScript for contrib

* Update dependencies

* Comment out documentations
2018-10-31 11:37:54 +09:00
ylemkimon
101501189c Enable environment variable USE_TTF to disable bundling TTF fonts (#1600)
* Use environment variable USE_TTF to disable bundling TTF fonts

* Do not bundle TTF fonts on CircleCI build
2018-08-13 13:12:33 +09:00
ylemkimon
237986a7ca Change build directory to dist and cleanup NPM scripts (#1500)
* Move the build path to `dist`

* mkdir dist if not exists

* Remove build from .gitignore

* Delete `dist/` before building and when cleaning
2018-07-23 12:46:15 -04:00
greenkeeper[bot]
78870abbe8 Update css-loader to the latest version 🚀 and use postcss-loader and cssnano to minimize CSS (#1464)
* chore(package): update css-loader to version 1.0.0

* Require minimum Node 6.9

* Use `postcss-loader` and `cssnano` to minimize CSS

* chore(package): update lockfile

* Remove unnecessary `ident` and function

* chore(package): update cssnano to version 4.0.1
2018-07-22 15:37:19 +09:00
ylemkimon
3f1b13e352 Fix Webpack global function definition, including hot module replacement (#1435)
* Upgrade webpack-cli to 3.0.1

* Wrap output.globalObject in parentheses

Fix global function definition, such as hot module update.
2018-06-17 08:19:02 -04:00
Erik Demaine
32fe81ae40 Enable output modules to be used in browser or Node (#1401)
This makes cli.js work again from the Node command line

Workaround from https://github.com/webpack/webpack/issues/6522
2018-06-02 19:33:46 -04:00
ylemkimon
25e07a7df6 Upgrade to webpack 4 (#1337) 2018-05-28 05:20:33 +02:00
ylemkimon
30854eb866 Enable hot module replacement(HMR) (#1100)
* Use ES6 in static/main.js

+ Lint static/main.js

* Enable hot module replacement(HMR) in webpack-dev-server

* Disable no-console in static/main.js

* Use seperate entry point/bundle for the test page(/static/main.js)
2018-02-01 13:33:49 -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