Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9445 closed New Feature (fixed)

Builder: Make it possible to append js files to ckeditor.js

Reported by: Frederico Caldeira Knabben Owned by: Wiktor Walc
Priority: Normal Milestone:
Component: Project : CKBuilder Version:
Keywords: Cc:

Description

An option is required in the builder confirguration file (build-config.js) to make it possible to append JavaScript files to the resulting ckeditor.js file. It could be something like this:

js : [
    '/path/to/myfile.js',
    '/path/to/another.js'
]

These files should be then minified and appended at the end of ckeditor.js, in the provided order.

Change History (7)

comment:1 Changed 12 years ago by Wiktor Walc

Status: newassigned

comment:2 Changed 12 years ago by Wiktor Walc

Component: GeneralProject : CKBuilder
Status: assignedreview
Type: BugNew Feature

A new binary version of CKBuilder has been created: CKBuilder 1.4

To try it out, change CKBUILDER_VERSION in dev\builder\build.sh

The syntax is just like in TC. Absolute and relative paths are accepted.

Relative path starts in the builder directory, so if we want to include a foo.js file which is in the same folder as ckeditor-dev:

<dir>
   <ckeditor-dev>
      <dev>
         <builder>
            build.sh
   ...
   foo.js

we need to specify a path to a file located three levels above.

js : [
	'../../../foo.js'
],

comment:3 Changed 12 years ago by Wiktor Walc

I have added support for extra properties after the file name: start, aftercore, end. end is the default value, which means that if just a path to the file is provided, it will be appended at the end.

Download CKBuilder 1.4

Sample configuration:

	js : [
		'/path/to/1.js,end',
		'/path/to/2.js,aftercore',
		'/path/to/3.js,start',
		'/path/to/4.js,aftercore',
		'/path/to/5.js',
		'/path/to/6.js,start'
	]

will result in:

3.js
6.js
core
2.js
4.js
plugins
1.js
5.js

comment:4 Changed 12 years ago by Wiktor Walc

Resolution: fixed
Status: reviewclosed

The new version of CKBuilder has been enabled in with https://github.com/ckeditor/ckeditor-dev/commit/15d0d0163b

comment:5 in reply to:  4 Changed 12 years ago by Teresa Monahan

Replying to wwalc:

The new version of CKBuilder has been enabled in with https://github.com/ckeditor/ckeditor-dev/commit/15d0d0163b

Hi Wiktor, I noticed that js files specified through the new config mechanism provided in this ticket are not removed from the build output. Therefore they are included in the build twice - once as part of ckeditor.js and also in their original directory structure. Is it possible to remove these from the build output once they have been included in ckeditor.js? This would slightly reduce the install size of the editor.

Also I notice that config.js is minified as part of the build in v4. In previous releases this file was not compressed - was there a reason for changing this in v4? Minifying it makes it difficult to change values in this file to alter config options for the editor - is there a way to specify that this file should not be minified during the build process?

Thanks, Teresa

comment:6 Changed 12 years ago by Wiktor Walc

Hi Teresa,

Check CKBuilder 1.5.1 (to try it out, change CKBUILDER_VERSION in dev\builder\build.sh)

Files specified in "js" array and included in ckeditor.js, should be now removed from release folder.

Regarding leaving the configuration file unminified, such feature is already available and this is in fact the way how we process the configuration file in V4. In order to protect any JavaScript file against being minified, add this line inside a JavaScript file, for example at the bottom:

// %LEAVE_UNMINIFIED% %REMOVE_LINE%

comment:7 in reply to:  6 Changed 12 years ago by Teresa Monahan

Replying to wwalc:

Hi Wiktor, Thanks for the ckbuilder update and for the tip about how to leave files unminified. This is all working well for us now.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy