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 9afbbd8 + 3b1da90 commit 5f64e7d
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 { InlineEditor } from '@ckeditor/ckeditor5-build-inline/build/ckeditor';
import InlineEditor from '@ckeditor/ckeditor5-build-inline/build/ckeditor';

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

InlineEditor
.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 InlineEditor extends InlineEditorBase {}
export default class InlineEditor extends InlineEditorBase {}

InlineEditor.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 { InlineEditor } from '../ckeditor';
import InlineEditor from '../ckeditor';
import BaseInlineEditor from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';

describe( 'InlineEditor', () => {
describe( 'InlineEditor 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 InlineEditor = require( '../../build/ckeditor' ).InlineEditor;
const InlineEditor = require( '../../build/ckeditor' );

InlineEditor.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 { InlineEditor } from '../../build/ckeditor';
import InlineEditor from '../../build/ckeditor';

InlineEditor.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 5f64e7d

Please sign in to comment.