Hi guys.
I developed a website using grapejs.
I tried to use plugin grapejs-custom-code in my project.
The Installation was success. And also it works on my local.
But after deploying on server, the custom code element doesn't appear in category menu. and I couldn't use it.
I wonder if there is some settings on that I don't know.
I can't understand that's why.
Please help me.
my package.json is as follow.
import React, { Component } from 'react';
import { compose } from 'recompose';
import { BuildContainer, BuildFormContainer, MessagesContainer, DealsContainer, CampaignsContainer } from '@containers';
import BuildModal from '../@common/modals/builder';
import { Button, Icon, Dropdown, Popup, Modal } from 'semantic-ui-react';
import Loader from '../loader';
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-preset-webpage';
import basic from 'grapesjs-blocks-basic';
import forms from 'grapesjs-plugin-forms';
import pgexport from 'grapesjs-plugin-export';
import navbar from 'grapesjs-navbar';
import countdown from 'grapesjs-component-countdown';
import tabs from 'grapesjs-tabs';
import customcode from 'grapesjs-custom-code';
import 'grapesjs/dist/css/grapes.min.css';
import defaultPage from './default';
import './grapes.css';
import './index.scss';
import history from '../../history';
import { config } from "@services";
Hi guys. I developed a website using grapejs. I tried to use plugin grapejs-custom-code in my project. The Installation was success. And also it works on my local. But after deploying on server, the custom code element doesn't appear in category menu. and I couldn't use it. I wonder if there is some settings on that I don't know. I can't understand that's why. Please help me. my package.json is as follow.
{ "name": "frontend", "version": "0.1.0", "private": true, "dependencies": { "@babel/core": "7.1.6", "@date-io/date-fns": "^1.3.9", "@material-ui/core": "^4.3.3", "@material-ui/pickers": "^3.2.3", "@svgdotjs/svg.js": "^3.0.16", "@svgr/webpack": "2.4.1", "app-module-path": "^2.2.0", "axios": "^0.18.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "^24.5.0", "babel-loader": "8.0.4", "babel-plugin-named-asset-import": "^0.3.0", "babel-preset-react-app": "^7.0.0", "bfj": "6.1.1", "case-sensitive-paths-webpack-plugin": "2.1.2", "chalk": "2.4.1", "chart.js": "^2.7.3", "css-loader": "1.0.0", "date-fns": "^2.0.0-beta.5", "dom-to-image": "^2.6.0", "dotenv": "6.0.0", "dotenv-expand": "4.2.0", "fastpanel-api": "0.0.7", "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", "fs-extra": "7.0.0", "grapesjs": "^0.20.1", "grapesjs-blocks-basic": "^1.0.1", "grapesjs-component-countdown": "^1.0.1", "grapesjs-custom-code": "^1.0.1", "grapesjs-navbar": "^1.0.1", "grapesjs-plugin-export": "^1.0.11", "grapesjs-plugin-forms": "^2.0.5", "grapesjs-preset-webpage": "^1.0.2", "grapesjs-react": "^4.0.1", "grapesjs-tabs": "^1.0.6", "html-to-image": "^1.10.8", "html-webpack-plugin": "4.0.0-alpha.2", "html2canvas": "^1.4.1", "identity-obj-proxy": "3.0.0", "immutable": "^4.0.0-rc.12", "jest": "^24.5.0", "jest-pnp-resolver": "1.0.1", "jest-resolve": "23.6.0", "jodit-react": "^1.0.59", "js-cookie": "^2.2.1", "luxon": "^1.25.0", "mini-css-extract-plugin": "0.4.3", "moment": "^2.24.0", "moment-timezone": "^0.5.32", "node-sass": "^4.14.1", "nodemon": "^2.0.20", "optimize-css-assets-webpack-plugin": "5.0.1", "pnp-webpack-plugin": "1.1.0", "postcss-flexbugs-fixes": "4.1.0", "postcss-loader": "3.0.0", "postcss-preset-env": "6.3.1", "postcss-safe-parser": "4.0.1", "ramda": "^0.26.1", "react": "^16.14.0", "react-app-polyfill": "^0.2.0", "react-circular-progressbar": "^2.0.4", "react-confirm-alert": "^2.8.0", "react-copy-text": "^1.0.1", "react-day-picker": "^7.3.0", "react-dev-utils": "^7.0.1", "react-dom": "^16.14.0", "react-drag-drop-files": "^2.3.7", "react-html-parser": "^2.0.2", "react-image-crop": "^10.0.8", "react-json-view": "^1.19.1", "react-redux": "^7.1.3", "react-router-dom": "^4.3.1", "react-scripts": "^2.1.8", "react-toastify": "^4.5.2", "react-uploader": "^2.1.0", "recharts": "^2.0.3", "recompose": "^0.30.0", "redux": "^4.0.1", "redux-thunk": "^2.3.0", "reselect": "^4.0.0", "resolve": "1.8.1", "sass-loader": "7.1.0", "semantic-ui-css": "2.4.1", "semantic-ui-react": "0.84.0", "style-loader": "0.23.0", "terser-webpack-plugin": "1.1.0", "title-case": "^2.1.1", "twilio-client": "^1.12.5", "url-loader": "1.1.1", "webpack": "4.19.1", "webpack-dev-server": "3.1.14", "webpack-manifest-plugin": "2.0.4", "workbox-webpack-plugin": "3.6.3" }, "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", "test": "node scripts/test.js" }, "eslintConfig": { "extends": "react-app" }, "browserslist": [ ">0.2%", "not dead", "not ie <= 11", "not op_mini all" ], "jest": { "collectCoverageFrom": [ "src//*.{js,jsx,ts,tsx}", "!src/*/.d.ts" ], "resolver": "jest-pnp-resolver", "setupFiles": [ "react-app-polyfill/jsdom" ], "testMatch": [ "/src/ /tests/*/.{js,jsx,ts,tsx}",
"/src/*/?(.)(spec|test).{js,jsx,ts,tsx}"
],
"testEnvironment": "jsdom",
"testURL": "http://localhost",
"transform": {
"^.+\.(js|jsx|ts|tsx)$": "/node_modules/babel-jest",
"^.+\.css$": "/config/jest/cssTransform.js",
"^(?!.*\.(js|jsx|ts|tsx|css|json)$)": "/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\]node_modules[/\\].+\.(js|jsx|ts|tsx)$",
"^.+\.module\.(css|sass|scss)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\.module\.(css|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"web.js",
"js",
"web.ts",
"ts",
"web.tsx",
"tsx",
"json",
"web.jsx",
"jsx",
"node"
],
"moduleDirectories": [
"node_modules",
"src"
]
},
"babel": {
"presets": [
"react-app"
]
},
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-react-app": "^3.0.8",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"husky": "^1.3.1",
"lint-staged": "^8.1.4",
"ngrok": "^3.2.5"
},
"engines": {
"node": "v8.17.0",
"npm": "6.13.4"
}
}
and my code using custom code element.
import React, { Component } from 'react'; import { compose } from 'recompose'; import { BuildContainer, BuildFormContainer, MessagesContainer, DealsContainer, CampaignsContainer } from '@containers'; import BuildModal from '../@common/modals/builder';
import { Button, Icon, Dropdown, Popup, Modal } from 'semantic-ui-react'; import Loader from '../loader';
import grapesjs from 'grapesjs'; import plugin from 'grapesjs-preset-webpage'; import basic from 'grapesjs-blocks-basic'; import forms from 'grapesjs-plugin-forms'; import pgexport from 'grapesjs-plugin-export'; import navbar from 'grapesjs-navbar'; import countdown from 'grapesjs-component-countdown'; import tabs from 'grapesjs-tabs'; import customcode from 'grapesjs-custom-code';
import 'grapesjs/dist/css/grapes.min.css'; import defaultPage from './default'; import './grapes.css'; import './index.scss'; import history from '../../history'; import { config } from "@services";
import * as htmlToImage from 'html-to-image'; import { indexOf } from "ramda"; const svgNameList = ['column', '2columns', '3columns', '2col37', 'text', 'link', 'image', 'video', 'map', 'linkblock', 'quote', 'textsection', 'form', 'input', 'textarea', 'select', 'button', 'label', 'checkbox', 'radio', 'navbar', 'countdown', 'tabs', 'customcode' ];
const panelList = []; panelList[0] = []; panelList[1] = ['ti ti-device-desktop', 'ti ti-device-tablet', 'ti ti-device-mobile']; panelList[2] = ['ti ti-marquee-2', '', 'ti ti-arrows-maximize', 'ti ti-code', '', '', 'ti ti-file-import', 'ti ti-eraser']; panelList[3] = ['ti ti-pencil', 'ti ti-settings', 'ti ti-layers-subtract', 'ti ti-layout-grid'];
class Builder extends Component { state = { editor: {}, pages: [], preview: true, selPage: parseInt(localStorage.getItem('page_id')), zIndex: 4, show: false, pindex: 0, };
}
export default compose(BuildContainer, BuildFormContainer, MessagesContainer, DealsContainer, CampaignsContainer)(Builder);