Skip to content

Instantly share code, notes, and snippets.

@marufsiddiqui
Created October 15, 2018 09:56
Show Gist options
  • Save marufsiddiqui/06a7a6309961735da3f2df0a16670082 to your computer and use it in GitHub Desktop.
Save marufsiddiqui/06a7a6309961735da3f2df0a16670082 to your computer and use it in GitHub Desktop.
webpack.js
cacheGroups: {
critical: {
name: 'critical',
test: m => {
const name = m.identifier()
if (m.identifier().endsWith('.css') && name.includes('critical')) {
console.log('critical', name)
}
return m.identifier().endsWith('.css') && name.includes('critical')
},
chunks: 'all',
enforce: false
},
critical2: {
name: 'noncritical',
test: m => {
const name = m.identifier()
if (m.identifier().endsWith('.css') && !name.includes('critical')) {
console.log('non-critical', name)
}
return m.identifier().endsWith('.css') && !name.includes('critical')
},
chunks: 'all',
enforce: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment