Using Stylify CSS in Laravel Framework

Laravel integration is similar to Webpack configuration.

Integration example for the Laravel framework can be found in integrations examples repository .

How to integrate the Stylify into the Laravel Framework

First install the @stylify/unplugin package using NPM or Yarn:

npm i -D @stylify/unplugin
yarn add -D @stylify/unplugin

Next add Stylify plugin into the webpack.mix.js:

const { webpackPlugin } = require('@stylify/unplugin');

const stylifyPlugin = webpackPlugin({
    bundles: [{
        outputFile: './resources/css/homepage.css',
        files: ['./resources/views/welcome.blade.php']
    }],
    // Optional
    compiler: {
        // https://stylifycss.com/docs/stylify/compiler#variables
        variables: {},
        // https://stylifycss.com/docs/stylify/compiler#macros
        macros: {},
        // https://stylifycss.com/docs/stylify/compiler#components
        components: {},
        // ...
    }
});

mix.webpackConfig({
    mode: 'development',
    plugins: [stylifyPlugin]
});

Now you can use the commands for laravel mix.

Where to go next?