mathjs-webpack-loader
loader for mathjs parsed expression
Installation
npm install --save-dev mathjs-webpack-loader && npm install --save mathjs
Usage
expressions.mathjs
x^2 + x/4 + 3*y
x + y
webpack.config.js
moduleexports = module: rules: test: /\.mathjs?$/ loader: 'mathjs-webpack-loader' ;
index.js
;; const instance = mathjs;const compiled = ; console; // 20console; // 2
If only one expression contains in *.mathjs
file, then it will be return instead of array. Loader returns function which contains only one parameter - mathjs
instance, see configuration.
Steps to run example
- fork or clone repository
npm install
npm run build-example
- View
example/bundle.js
orexample/index.html
in browser