Minification of JS/CSS with Composer for compatibility

This commit is contained in:
Stefan Kalscheuer 2018-06-14 17:56:03 +02:00
parent 14a6387218
commit 358602bf48
7 changed files with 25 additions and 8 deletions

2
.gitignore vendored
View File

@ -3,3 +3,5 @@ composer.lock
/node_modules/
/dist/
.idea
**/*.min.css
**/*.min.js

View File

@ -2,8 +2,9 @@
* Contributors: Stefan Kalscheuer
* Tags: liveticker, feed, rss
* Requires at least: 3.8
* Requires at least: 4.0
* Tested up to: 4.9
* Requires PHP: 5.2
* Stable tag: 1.0.0-alpha
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -128,7 +128,7 @@ class RoboFile extends Tasks {
$this->testCS();
}
$this->bundle();
$this->minify( $opts );
// $this->minify( $opts );
}
/**

View File

@ -31,16 +31,26 @@
"wimg/php-compatibility": "^8.0",
"wp-coding-standards/wpcs": "~0.14",
"patchwork/jsqueeze": "^2.0.5",
"natxet/CssMin": "^3.0.5"
"natxet/CssMin": "^3.0.5",
"matthiasmullie/minify": "^1.3"
},
"scripts": {
"post-install-cmd": [
"@minify"
],
"post-update-cmd": [
"@minify"
],
"build": [
"@minify",
"robo build"
],
"package": [
"@minify",
"robo package"
],
"deploy": [
"@minify",
"robo deploy:all"
],
"test-all": [
@ -55,6 +65,10 @@
],
"fix-cs": [
"phpcbf --standard=phpcs.xml"
],
"minify": [
"minifycss styles/wp-liveticker2.css > styles/wp-liveticker2.min.css",
"minifyjs scripts/wp-liveticker2.js > scripts/wp-liveticker2.min.js"
]
}
}

View File

@ -250,7 +250,7 @@ class WPLiveticker2 {
if ( self::$shortcode_present || self::$widget_present ) {
wp_enqueue_style(
'wplt-css',
WPLT2_BASE . 'styles/wp-liveticker2.css',
WPLT2_BASE . 'styles/wp-liveticker2.min.css',
'',
self::VERSION, 'all'
);
@ -265,7 +265,7 @@ class WPLiveticker2 {
if ( self::$shortcode_present || self::$widget_present ) {
wp_enqueue_script(
'wplt2-js',
WPLT2_BASE . 'scripts/wp-liveticker2.js',
WPLT2_BASE . 'scripts/wp-liveticker2.min.js',
array( 'jquery' ),
self::VERSION,
true

View File

@ -21,6 +21,6 @@
</rule>
<!-- PHP compatibility level -->
<config name="testVersion" value="5.5-"/>
<config name="testVersion" value="5.2-"/>
<rule ref="PHPCompatibility"/>
</ruleset>

View File

@ -11,7 +11,7 @@
* Description: A simple Liveticker for Wordpress.
* Version: 1.0.0 alpha
* Author: Stefan Kalscheuer
* Author URI: http://www.stklcode.de
* Author URI: https://www.stklcode.de
* Text Domain: wplt2
* Domain Path: /lang
* License: GPLv2 or later