How to use the @stylable/module-utils.generateModuleSource function in @stylable/module-utils

To help you get started, we’ve selected a few @stylable/module-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / stylable / packages / webpack-plugin / src / stylable-generator.ts View on Github external
public createModuleSource(
        module: StylableModule,
        moduleId: string,
        stylableResult: StylableResults,
        css: string,
        depth: string | number,
        renderableOnly = false
    ) {
        const moduleSource = generateModuleSource(
            stylableResult,
            moduleId,
            [],
            this.options.includeCSSInJS ? `${WEBPACK_STYLABLE}.$` : 'null',
            `${WEBPACK_STYLABLE}.create`,
            `${WEBPACK_STYLABLE}.createRenderable`,
            css,
            typeof depth === 'number' ? depth.toString() : depth,
            'module.' + module.exportsArgument,
            this.options.experimentalHMR
                ? `/* Webpack HMR */ if (module && module.hot) { module.hot.accept(); }`
                : '',
            renderableOnly
        );

        return new OriginalSource(moduleSource, module.resource);

@stylable/module-utils

Stylable module creation utilities

MIT
Latest version published 2 months ago

Package Health Score

69 / 100
Full package analysis

Similar packages