New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM Package does not work. #658
Comments
I didn't see you guys chatting about it, where was that? I assume by "does not work" you mean that you aren't able to My current plan is to switch to Rollup and have it output |
Someone came into Slack today to chat about this, and managed to use MathQuill with browserify-shim using the following config:
https://mathquill.slack.com/archives/mathquill/p1467223762000717 If you're using Browserify, let me know if that works for you |
I was the one who was on slack earlier 😄 Let me know if I can be of help! |
@rkotcher I have never use browserify-shim before. Is there any other thing that I should do other than adding that config to package.json? |
I have a fork that I publish to npm with built files (good for webpack or browserify) https://github.com/FB-PLP/mathquill. It is published as node-mathquill and it mostly follows the versioning from this repo. |
If you are using webpack, you can use loaders to import mathquill, like @laughinghan explains, but with webpack instead. Install the following loaders: $ npm install --save-dev exports-loader imports-loader Then you can import mathquill like this: const MathQuill = require('exports-loader?window.MathQuill!imports-loader?window.jQuery=jquery!mathquill/build/mathquill.js')
const MQ = MathQuill.getInterface(2) |
Still not working |
Can anyone give me a link to take components to add equation in the text field |
I am not using web pack .. can you guide |
@gselvamary I have made a React wrapper, which uses Webpack, take a look at how it's implemented react-mathquill. |
@viktorstrate Hi... You did a great job.. I am working with your wrapper only.... I have the problem in this line |
@viktorstrate I am not using web pack and yarn |
This method only works with Webpack, you need to use webpack to import it this way. If you have further questions please write to me at viktorstrate@gmail.com, to keep this thread focused on the original issue. 😉 |
A more complete reference of viktorstrate's Webpack installation guide that includes required CSS file: import { getInterface } from 'exports-loader?window.MathQuill!imports-loader?window.jQuery=jquery!mathquill/build/mathquill.js';
import "mathquill/build/mathquill.css";
const MQ = getInterface(2);
// start using mathquill
const mathField = MQ.MathField(document.getElementById("mathField")); Remember to install exports and imports loader:
|
I was trying to install Mathquill as an NPM dependency, and, talking with Andrew Hyndman (@ajhyndman) on the Slack channel, he realized that the main script is not defined in package.js, which might be the issue.
The text was updated successfully, but these errors were encountered: