magento-frontend
Magento 2 Minify all assets files in public path
Install
npm i -D magento-frontend
yarn add -D magento-frontend
Argumnets
basePath: type:String
themes: type: Array
options: type: Object
Options:
debug
: type Boolean, default false
uglify
: you uglify confing
autoprefixer
: you autoprefixer confing
csso
: you csso confing
Usage
Create js file in magento2 instal folder myfile.js
And insert this code :
let optimazer = require('magento-frontend');
optimazer(__dirname,[{
vendor:'Magento',
theme:'luma',
lang:'en_US'
},{
vendor:'Magento',
theme:'blank',
lang:'en_US'
}],{
debug:true,
uglify:{},
autoprefixer:{},
csso:{}
});
Run
node ./myfile.js