How to use the @modular-css/processor function in @modular-css/processor

To help you get started, we’ve selected a few @modular-css/processor 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 tivac / modular-css / packages / www / src / repl / store.js View on Github external
import fs from "fs";
import path from "path";

import { Store } from "svelte/store";
import Processor from "@modular-css/processor";
import lz from "lznext";

import listen from "./listen.js";
import { prompt } from "./data/prompt.js";

const processor = new Processor({
    cwd : "/",

    // Custom file resolver to work around gaps in fake node environment
    resolvers : [
        (src, file) => path.resolve(`/${file}`),
    ],
});

// iterators are so much fun
const first = (set) => set.values().next().value;


class CssStore extends Store {
    constructor(...args) {
        super(...args);
github tivac / modular-css / packages / www / src / repl / processor.js View on Github external
import path from "path";

import Processor from "@modular-css/processor";

const processor = new Processor({
    cwd : "/",

    // Custom file resolver to work around gaps in fake node environment
    resolvers : [
        (src, file) => path.resolve(`/${file}`),
    ],
});

export default processor;
github tivac / modular-css / packages / www / state.js View on Github external
import fs from "fs";

import Processor from "@modular-css/processor";

var state =  {
    files : [],

    output : {
        css : "",
        js  : false,
    },

    processor : new Processor({
        resolvers : [
            (src, file) => {
                file = file.replace(/^\.\.\/|\.\//, "");

                return `/${file}`;
            },
        ],
    }),
    
    tab : "CSS",
    
    error : false,
};

export function createFile() {
    var file = `/${state.files.length + 1}.css`;

@modular-css/processor

A streamlined reinterpretation of CSS Modules

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis