Skip to content

atmajs/mask-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minify, Combine, Optimize Mask Templates

Build Status

What you get?

Minifier
div.fooClass {
	if (user) {
		div {
			i > 'User '
			foo {
				'~[user]'
			}
		}
	}
}
.fooClass>if(user)>div{i>'User 'foo>'~[user]'}
Builder
import foo from 'foo.mask';
footer > foo;
module path='foo.mask' {
	define foo {
		span > 'Lorem Ipsum'
	}
}
import foo from 'foo.mask';
footer > foo;
Custom optimizations and preprocessors

Optimizer itself should be defined in settings so that this library runs all optimizers via the template. For Instance markdown plugin can convert Markdown markup to html for better client performance.

section > :md > """
	### Hello
	_Baz_
"""
section > :html > """
	<h6>Hello</h6>
	<i>Baz</i>
"""

Node.js

npm install mask-optimizer
var Optimizer = require('mask-optimizer');

// template string
var minified = Minifier.optimize(template);

// files
Minifier.optimizeFiles(String|Array|Glob files, String|Array output);

Minifier.optimizeFiles('views/foo.mask'); // output in `views/foo.min.mask`
Minifier.optimizeFiles('views/*.mask'); // output in `views/*.min.mask`

Minifier.optimizeFiles('foo.mask', '/release/foo.mask'); 
Atma.Toolkit Plugin

Use this as a Plugin for io.File.read to minify Mask markup

  • when building Single-Page Application with the Atma.Toolkit, all the templates are embedded and minified into the resulting output html file.

  • when building Atma Server Application, all templates are minified and combined into single html file for each Page ID

Install plugin localy (for single project)
cd my-project
atma plugin install mask-minify
Install plugin global
atma plugin install mask-minify -g

This will install mask-minify module from the NPM repository, and will update current package.json.


©️ - 2015 - The Atma.js Project - MIT

About

Mask minification module and Atma.Toolkit plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published