Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function cssExtract (bundle, opts) {
// extract css from chunks
// obj -> str
function extract (chunk) {
// Do a performant check before building the ast
if (String(chunk.source).indexOf('insert-css') === -1) return ''

const css = []
const ast = falafel(chunk.source, { ecmaVersion: 6 }, walk)
chunk.source = ast.toString()
Expand Down