Skip to content

Commit 54a4c64

Browse files
committed
Revert "Skip non-matching insert-css statements"
reverts commit fbb0963 in favor of #3 (comment).
1 parent 117b5ad commit 54a4c64

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ function extract (chunk) {
5757
if (!node.arguments) return
5858
if (!node.arguments[0]) return
5959
if (node.arguments[0].value !== 'insert-css') return
60-
if (!node.parent.arguments || !node.parent.arguments[0]) return
61-
6260
css.push(node.parent.arguments[0].value)
6361
node.parent.update('0')
6462
}

test/index.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,4 @@ test('css-extract', function (t) {
2929
})
3030
}
3131
})
32-
33-
t.test('should leave non-matching insert-css statements inline', function (t) {
34-
t.plan(4)
35-
36-
browserify(path.join(__dirname, 'manual-insert-source.js'))
37-
.plugin(cssExtract, { out: readCss })
38-
.bundle(readJs)
39-
40-
function readCss () {
41-
return bl(function (err, data) {
42-
t.ifError(err, 'no error')
43-
t.equal(String(data), '', 'no css extracted')
44-
})
45-
}
46-
47-
function readJs (err, data) {
48-
t.ifError(err, 'no error')
49-
const source = fs.readFileSync(path.join(__dirname, 'manual-insert-source.js'), 'utf8')
50-
t.ok(String(data).indexOf(String(source)) !== -1, 'source is still in built bundle')
51-
}
52-
})
5332
})

test/manual-insert-source.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)