Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit e5c7511

Browse files
committed
Merge branch t/ckeditor5/545
Other: The build now defines the editor as its default export. This makes requiring the build easier when using AMD, CJS or ES6 modules. See ckeditor/ckeditor5#545. BREAKING CHANGE: The build now defines a default export instead of named export. See ckeditor/ckeditor5#545.
2 parents 4b89b48 + c98781a commit e5c7511

9 files changed

+13
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ And use it in your website:
4747
Or in your JavaScript application:
4848

4949
```js
50-
import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic/build/ckeditor';
50+
import ClassicEditor from '@ckeditor/ckeditor5-build-classic/build/ckeditor';
5151

5252
// Or using CommonJS verion:
53-
// const ClassicEditor = require( '@ckeditor/ckeditor5-build-classic/build/ckeditor' ).ClassicEditor;
53+
// const ClassicEditor = require( '@ckeditor/ckeditor5-build-classic/build/ckeditor' );
5454

5555
ClassicEditor
5656
.create( document.querySelector( '#editor' ) )

build/ckeditor.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ckeditor.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckeditor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link';
1818
import ListPlugin from '@ckeditor/ckeditor5-list/src/list';
1919
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
2020

21-
export class ClassicEditor extends ClassicEditorBase {}
21+
export default class ClassicEditor extends ClassicEditorBase {}
2222

2323
ClassicEditor.build = {
2424
plugins: [

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@ckeditor/ckeditor5-paragraph": "^0.9.0"
2323
},
2424
"devDependencies": {
25-
"@ckeditor/ckeditor5-dev-utils": "^3.0.0",
25+
"@ckeditor/ckeditor5-dev-utils": "^4.0.0",
2626
"@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11",
2727
"babel-minify-webpack-plugin": "^0.2.0",
2828
"css-loader": "^0.28.5",

tests/ckeditor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
/* globals document */
77

8-
import { ClassicEditor } from '../ckeditor';
8+
import ClassicEditor from '../ckeditor';
99
import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
1010

11-
describe( 'ClassicEditor', () => {
11+
describe( 'ClassicEditor build', () => {
1212
let editor, editorElement;
1313

1414
beforeEach( () => {

tests/manual/ckeditor-cjs-version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* For licensing, see LICENSE.md.
44
*/
55

6-
const ClassicEditor = require( '../../build/ckeditor' ).ClassicEditor;
6+
const ClassicEditor = require( '../../build/ckeditor' );
77

88
ClassicEditor.create( document.querySelector( '#editor' ) )
99
.then( editor => {

tests/manual/ckeditor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* For licensing, see LICENSE.md.
44
*/
55

6-
import { ClassicEditor } from '../../build/ckeditor';
6+
import ClassicEditor from '../../build/ckeditor';
77

88
ClassicEditor.create( document.querySelector( '#editor' ) )
99
.then( editor => {

webpack.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ module.exports = {
2222
output: {
2323
path: path.resolve( __dirname, 'build' ),
2424
filename: 'ckeditor.js',
25-
libraryTarget: 'umd'
25+
libraryTarget: 'umd',
26+
libraryExport: 'default',
27+
library: buildConfig.moduleName
2628
},
2729

2830
plugins: [

0 commit comments

Comments
 (0)