-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update build process to minify .js to .min versions #5
Comments
The first stage of this, to attempt to complete the changes for bobbingwide/oik-nivo-slider#11, was to update the minify.bat file to use the latest yuicompressor. (v2.4.8 ). It wasn't particularly successful. I concluded it would be better to look at what other plugins are doing. |
I've already linked a number of repositories to the Peaceful coexistence project because they included some JavaScript source.
Perhaps this table will help answer the questions
oik-external-link-warningDepends on class-oik-jquery to enqueue jquery-ui-tooltip .js and .css ? |
I’ll have to complete the transfer to using the class-oik-jquery library at some time. Is now a good time? |
In the PhPStorm documentation they suggest using Since there are only a few files, and they're all quite small, I'm going to try configuring
|
It wasn’t at all obvious that the UglifyJS method in PhpStorm worked. I copied/cobbled minified.bat to uglify.bat and tried it on a couple of files. This worked. Then I noticed that there was a I believe this was because of a checkbox that caused PhpStorm to detect external file changes. Some time in the future I’m going to look at defining Multiple Entry Points with webpack. But first I'll just edit |
The new solution for building .min.js versions of the files delivered by oik, oik-nivo-slider and list of other plugins tbc
|
.min
or.pack
within the file name.SCRIPT_DEBUG
is true..css
files that may need updating and re-minifying.Requirements
.js
and.css
filesnpm
.Current solution
7 years ago, I wrote a
minify.bat
file for my oik plugin.This used
yuicompressor v2.4.7
, which requires Java.e.g. to create the
oik.min.css
file fromoik.css
Initial solution - resurrect
yuicompressor
The initial solution would be to add logic to
oik-zip
to run theyuicompressor
for any.js
or.css
file that needs a.pack
or.min
version.Nope. That was no good.
Alternative solution - uglifyjs
This looks better.
minify.bat
touglify.bat
and use it to uglify the .js files that need it.Longer term solution
Later I can find a way of incorporating the minifying logic into the
npm
build steps.npm
to build the blocks and run internationalization and localization routines.See Update to support makepot logic run against JavaScript files oik-i18n#6
oik-zip
for other functionality.oik-zip
.References
YUI Compressor
WordPress code build tools
WordPress TRAC #43731
Grunt
Gulp minify
Webpack MiniCssExtractPlugin
Minifying JavaScript with PhpStorm
The text was updated successfully, but these errors were encountered: