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

Commit

Permalink
Merge branch t/ckeditor5/545
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Reinmar committed Sep 7, 2017
2 parents 4b89b48 + c98781a commit e5c7511
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ And use it in your website:
Or in your JavaScript application:

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

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

ClassicEditor
.create( document.querySelector( '#editor' ) )
Expand Down
2 changes: 1 addition & 1 deletion build/ckeditor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/ckeditor.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link';
import ListPlugin from '@ckeditor/ckeditor5-list/src/list';
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';

export class ClassicEditor extends ClassicEditorBase {}
export default class ClassicEditor extends ClassicEditorBase {}

ClassicEditor.build = {
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@ckeditor/ckeditor5-paragraph": "^0.9.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-utils": "^3.0.0",
"@ckeditor/ckeditor5-dev-utils": "^4.0.0",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11",
"babel-minify-webpack-plugin": "^0.2.0",
"css-loader": "^0.28.5",
Expand Down
4 changes: 2 additions & 2 deletions tests/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

/* globals document */

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

describe( 'ClassicEditor', () => {
describe( 'ClassicEditor build', () => {
let editor, editorElement;

beforeEach( () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/ckeditor-cjs-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

const ClassicEditor = require( '../../build/ckeditor' ).ClassicEditor;
const ClassicEditor = require( '../../build/ckeditor' );

ClassicEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

import { ClassicEditor } from '../../build/ckeditor';
import ClassicEditor from '../../build/ckeditor';

ClassicEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ module.exports = {
output: {
path: path.resolve( __dirname, 'build' ),
filename: 'ckeditor.js',
libraryTarget: 'umd'
libraryTarget: 'umd',
libraryExport: 'default',
library: buildConfig.moduleName
},

plugins: [
Expand Down

0 comments on commit e5c7511

Please sign in to comment.