Skip to content

Commit

Permalink
Update index.js, fix grapesjs loading
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Nov 6, 2017
1 parent b4dbbbd commit eebc8b4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,19 @@ Install it
$ npm i
```

Start the dev server
The plugin relies on GrapesJS via `peerDependencies` so you have to install it manually (without adding it to package.json)

```sh
$ npm start
$ npm i grapesjs --no-save
```

Build before the commit. This will also increase the patch level version of the package
Start the dev server

```sh
$ npm run build
$ npm start
```



## License

BSD 3-Clause
7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
<head>
<meta charset="utf-8">
<title>GrapesJS Plugin</title>
<link rel="stylesheet" href="./node_modules/grapesjs/dist/css/grapes.min.css">
<!--
<script src="./node_modules/grapesjs/dist/grapes.min.js"></script>
-->
<script src="private/grapes.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
<script src="https://unpkg.com/grapesjs"></script>
<script src="./dist/grapesjs-plugin-forms.min.js"></script>
<style>
body, html{ height: 100%; margin: 0;}
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"useBuiltIns": true
}
]
],
"plugins": [
"transform-object-rest-spread"
]
},
"peerDependencies": {
Expand All @@ -42,6 +45,7 @@
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"webpack": "^3.8.1",
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
grapesjs.plugins.add('gjs-plugin-forms', (editor, opts) => {
import gjs from 'grapesjs';
const g = grapesjs || gjs;

export default g.plugins.add('gjs-plugin-forms', (editor, opts) => {
let c = opts || {};
let config = editor.getConfig();
let pfx = config.stylePrefix;
Expand Down

0 comments on commit eebc8b4

Please sign in to comment.