@stylable/node
TypeScript icon, indicating that this package has built-in type declarations

6.1.1 • Public • Published

@stylable/node

npm version

@stylable/node is a simple integration that allows integrating Stylable into your node application. The most common use-case is server-side rendering.

Installation

yarn add --dev @stylable/node

Usage

Import the attachHook utility from @stylable/node, and invoke it. The attachHook can receive optional arguments in the form of a config object.

See the type definition here.

const {attachHook} = require('@stylable/node');
attachHook();

const { style, classes } = require('./stylesheet.st.css');

attachHook Options

interface Options {
    /* override .st.css file match */
    matcher?: (filename: string) => boolean;
    /* stylable instance configure */
    stylableConfig?: Partial<StylableConfig>;
    /* hook for after compile */
    afterCompile?: (code: string, filename: string) => string;
    /* request for the @stylable/runtime */
    runtimePath?: string;
    /* should ignore built .st.css.js files */
    ignoreJSModules?: boolean;
}

License

Copyright (c) 2017 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a MIT license.

/@stylable/node/

    Package Sidebar

    Install

    npm i @stylable/node

    Weekly Downloads

    2,591

    Version

    6.1.1

    License

    MIT

    Unpacked Size

    35.8 kB

    Total Files

    39

    Last publish

    Collaborators

    • tomrav
    • avi.vahl
    • idoros
    • baraki
    • cijoe
    • alexswix