Generate a new grapes.min.js after make changes to grapes.js
Question
Hi guys - happy new year,
I'm currently doing some investigation of GrapesJs for our further project.
The question is I fellow the https://github.com/artf/grapesjs/issues/196 to minify a new grapes.min.js, but when I deleted the grapes.min.js and tried to make some change in the grapes.js which is in the dist folder, for example, changed the logic in the **removeClass** function:
`function removeClass(v, c) {
if (v.classList) {
v.classList.remove(c);
} else {
if (v.className instanceof SVGAnimatedString) {
// doing something
} else {
v.className = v.className.replace(c, "");
}
}
}`
, and then run the command `npm run build` to generate a new grapes.min.js, but the modifications were reverted back to what it was after running that command:
`function removeClass(v, c) {
if (v.classList) {
v.classList.remove(c);
} else {
v.className = v.className.replace(c, "");
}
}`
how can I make the changes come into effect in the grapes.min.js after making changes to **grapes.js** ? Any other config change should I make? Thank you very much!Answers (2)
@frank-tenzing you shouldn't edit files in the dist folder, those are generated every time by npm run build You have to edit files inside src.
BTW that code seems to come from cash library, not grapesjs itself (about the issue let's keep talking here #768 )
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1051
[BUG] CommandAbstract's callRun and callStop should return result for backward compatibility
Hi @artf, after the latest upgrade (0.14.9) some of my commands that rely on the results of other commands fail. This happens because of th...
Issue #1247
Text disappear after creating a new type
Hello! I am creating a new block that will open a modal during the creation (drag and drop https://github.com/artf/grapesjs/issues/174 real...
Issue #980
[BUG] Related with task https://github.com/artf/grapesjs/issues/873
Hello, After restoring editor from db still have some part of bug present. It seems inside of script: function () traits will have old valu...
Issue #1908
[question] Cannot read property 'indexOf' of undefined
I found a previous result here: https://github.com/artf/grapesjs/issues/1772 however I can still not get it to work, using the most basic s...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.