0.8.1 • Published 9 months ago

yff v0.8.1

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

Simple CSS/JS bundler for Yii2 projects

Install

# Create Yii2 project
composer create-project --prefer-dist yiisoft/yii2-app-advanced my-site
cd my-site
php init

# Install bundler
npx yff --init
npm install

Usage

Available commands:

# Start development server with live reload
npm start

# Apply formatting to the source files
npm run style

# Check syntax and type errors
npm run lint

Config

Use build.config.js to override default paths:

export default ({clean, css, js, serve, watch}) => {
    serve.dir = 'frontend/web';
    clean.dir = 'frontend/web/bundles';

    css.input = 'frontend/views/layouts/main.css';
    css.output.dir = clean.dir;

    js.input = 'frontend/views/layouts/main.js';
    js.output.dir = clean.dir;

    watch.dir = 'frontend/{controllers,models,views}';
    watch.files = '**/*.{php,html,svg}';
};

Other configuration files:

Advanced

Create multiple standalone bundles

css.input = ['frontend/views/layouts/main.css', 'frontend/views/blog/article.css'];
js.input =  ['frontend/views/layouts/main.js',  'frontend/views/blog/article.js'];

Split CSS by media query

Add --split-by-media option to the start command in the package.json:

"scripts": {
    "start": "yff --split-by-media --minify --reload",

Configure proxy server

Assign available options to the proxy field in the build.config.js

0.8.1

9 months ago

0.8.0

9 months ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.5.1

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.3.0

1 year ago

0.3.2

1 year ago

0.2.3

1 year ago

0.3.1

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.2

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago