-
-
Save marufsiddiqui/06a7a6309961735da3f2df0a16670082 to your computer and use it in GitHub Desktop.
webpack.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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