lib/processor.js
function (ctx, next) {
        var plugins = []
        var config = process.cssy.config

        ctx.imports = []

        var parseImportPlugin = postcss.plugin('cssy-parse-imports', function () {
          return function (styles) {
            styles.walkAtRules(function (atRule) {
              if (atRule.name !== 'import') {
                return
              }
              if (/^url\(|:\/\//.test(atRule.params)) {
                return // Absolute
              }
              ctx.imports.push(parseImport(atRule.params))
              atRule.remove()
            })
          }
        })

        if (ctx.config.import) {
          plugins.push(parseImportPlugin)
        }

        if (config.minify) {
          plugins.push(cssnano(extend({}, (typeof config.minify === 'object')
            ? config.minify : DEFAULT_MINIFY_OPTIONS)))
        }
        postcss(plugins)
          .process(ctx.src, {
            from: ctx.filename,
            to: ctx.filename + '.map',
            map: {
              prev: ctx.map,
              inline: config.sourcemap
            }
          })
          .then(function (result) {
            ctx.src = result.css
            if (config.sourcemap) {
              // TODO: Dig sourcemap, dig more.
              ctx.src += '\n/*# sourceURL=' + ctx.filename + '.output*/'
            }
            ctx.map = result.map
            next(null, ctx)
          })

        next(null, ctx)
      }
function (ctx, next) {
        var plugins = []
        var config = process.cssy.config

        ctx.imports = []

        var parseImportPlugin = postcss.plugin('cssy-parse-imports', function () {
          return function (styles) {
            styles.walkAtRules(function (atRule) {
              if (atRule.name !== 'import') {
                return
              }
              if (/^url\(|:\/\//.test(atRule.params)) {
                return // Absolute
              }
              ctx.imports.push(parseImport(atRule.params))
              atRule.remove()
            })
          }
        })

        if (ctx.config.import) {
          plugins.push(parseImportPlugin)
        }

        if (config.minify) {
          plugins.push(cssnano(extend({}, (typeof config.minify === 'object')
            ? config.minify : DEFAULT_MINIFY_OPTIONS)))
        }
        postcss(plugins)
          .process(ctx.src, {
            from: ctx.filename,
            to: ctx.filename + '.map',
            map: {
              prev: ctx.map,
              inline: config.sourcemap
            }
          })
          .then(function (result) {
            ctx.src = result.css
            if (config.sourcemap) {
              // TODO: Dig sourcemap, dig more.
              ctx.src += '\n/*# sourceURL=' + ctx.filename + '.output*/'
            }
            ctx.map = result.map
            next(null, ctx)
          })

        next(null, ctx)
      }
function ( ctx , next ) { var plugins = [ ] var config = process . cssy . config ctx . imports = [ ] var parseImportPlugin = postcss . plugin ( 'cssy-parse-imports' , function ( ) { return function ( styles ) { styles . walkAtRules ( function ( atRule ) { if ( atRule . name !== 'import' ) { return } if ( / ^url\(|:\/\/ / . test ( atRule . params ) ) { return // Absolute } ctx . imports . push ( parseImport ( atRule . params ) ) atRule . remove ( ) } ) } } ) if ( ctx . config . import ) { plugins . push ( parseImportPlugin ) } if ( config . minify ) { plugins . push ( cssnano ( extend ( { } , ( typeof config . minify === 'object' ) ? config . minify : DEFAULT_MINIFY_OPTIONS ) ) ) } postcss ( plugins ) . process ( ctx . src , { from : ctx . filename , to : ctx . filename + '.map' , map : { prev : ctx . map , inline : config . sourcemap } } ) . then ( function ( result ) { ctx . src = result . css if ( config . sourcemap ) { // TODO: Dig sourcemap, dig more. ctx . src += '\n/*# sourceURL=' + ctx . filename + '.output*/' } ctx . map = result . map next ( null , ctx ) } ) next ( null , ctx ) }
6. Extract importations and generate source
6 . Extract importations and generate source