From 3bdeeed25fe853f045bc59797b96b06235207b94 Mon Sep 17 00:00:00 2001 From: Andrew Joslin Date: Sun, 14 Aug 2016 19:30:40 -0700 Subject: [PATCH] Run in 'label' phase instead of 'debug' phase This makes css-extract run before bundle-collapser. bundle-collapser will change `require('insert-css')` to a number, eg `require(1)`, which will break css-extract. Closes #5 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 35c4b41..e654d84 100644 --- a/index.js +++ b/index.js @@ -27,8 +27,8 @@ function cssExtract (bundle, opts) { ? outFile() : bl(writeComplete) - // run before the "debug" step in browserify pipeline - bundle.pipeline.get('debug').unshift(extractStream) + // run before the "label" step in browserify pipeline + bundle.pipeline.get('label').unshift(extractStream) function write (chunk, enc, cb) { // Performance boost: don't do ast parsing unless we know it's needed