Browse Source

adding ckeditor to webpackencore

master
Charly 2 years ago
parent
commit
f7a3687ddb
4 changed files with 13 additions and 20 deletions
  1. +0
    -1
      composer.json
  2. +2
    -19
      config/packages/fos_ckeditor.yaml
  3. +1
    -0
      package.json
  4. +10
    -0
      webpack.config.js

+ 0
- 1
composer.json View File

@@ -89,7 +89,6 @@
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [

+ 2
- 19
config/packages/fos_ckeditor.yaml View File

@@ -1,24 +1,7 @@
# Read the documentation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html

fos_ck_editor:
input_sync: true
default_config: base_config
configs:
base_config:
filebrowserBrowseRoute: file_manager
filebrowserBrowseRouteParameters:
conf: default
module: ckeditor
format_tags: 'p;h2;h3'
toolbar:
- { name: "styles", items: ['Bold', 'Italic','Underline', 'Strike']}
- { name: "paragraph", items: ['Format', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'] }
- { name: "link", items: [ 'Link', 'Unlink'] }
- {name: 'insert', items: [ 'Image' ]}
- {name: 'document', items: [ 'Source' ]}
simple_config:
toolbar:
- { items: ['Bold', 'Italic', 'Underline', 'Colors', 'Source'] }
base_path: "build/ckeditor"
js_path: "build/ckeditor/ckeditor.js"
twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'

+ 1
- 0
package.json View File

@@ -11,6 +11,7 @@
"@symfony/stimulus-bridge": "^2.0.0",
"@symfony/webpack-encore": "^1.4.0",
"bootstrap-daterangepicker": "^3.1.0",
"ckeditor": "^4.12.1",
"core-js": "^3.0.0",
"regenerator-runtime": "^0.13.2",
"sass": "^1.34.0",

+ 10
- 0
webpack.config.js View File

@@ -84,6 +84,16 @@ Encore
config.corejs = 3;
})

//ckeditor config
.copyFiles([
{from: './node_modules/ckeditor/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
{from: './node_modules/ckeditor/adapters', to: 'ckeditor/adapters/[path][name].[ext]'},
{from: './node_modules/ckeditor/lang', to: 'ckeditor/lang/[path][name].[ext]'},
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'},
{from: './node_modules/ckeditor/vendor', to: 'ckeditor/vendor/[path][name].[ext]'}
])


// enables Sass/SCSS support
//.enableSassLoader()

Loading…
Cancel
Save