Skip to content

Instantly share code, notes, and snippets.

new webpack.optimize.UglifyJsPlugin({
mangle: true,
unused: true,
dead_code: true, // big one--strip code that will never execute
warnings: false, // good for prod apps so users can't peek behind curtain
drop_debugger: true,
conditionals: true,
evaluate: true,
drop_console: true, // strips console statements
sequences: true,
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// this assumes your vendor imports exist in the node_modules directory
// and will move all modules from there to separate bundle
return module.context && module.context.indexOf('node_modules') !== -1;
}
}),
entry: {
'main': './src/main/index.jsx',
'admin': './src/admin/index.jsx',
'reporting': './src/reporting/index.jsx'
},
core-js: 197.72 KB (20.9%)
moment: 129.59 KB (13.7%)
react-dom: 107 KB (11.3%)
lodash: 97.67 KB (10.3%)
react-router/es/Router.js DayOne/DOS/web: 75.74 KB (8.03%)
react-router-dom/es/Router.js DayOne/DOS/web: 75.74 KB (100%)
react-router-dom/es/BrowserRouter.js DayOne/DOS/web: 75.74 KB (100%)
react-router-dom/es/HashRouter.js DayOne/DOS/web: 75.74 KB (100%)
...
@marekpiechut
marekpiechut / git-cleanup.sh
Created December 14, 2017 10:19
GIT branches cleanup procedure
#Wipe all branches already merged on origin
git remote prune origin
#Remove all branches already merged to master
git branch --merged master | grep -v 'master' | xargs git branch -d
#Now let's check what's left
git branch
#Remove all other branches except master, leave-me and im-also-important
!!!WARNING: WILL DELETE UNMERGED BRANCHES, DOUBLE CHECK!!!
git branch | grep -Ev "master|leave-me|im-also-important" | xargs git branch -D
function testFunction() {
console.log('just log me!');
return 32;
}
function testFunction() {
console.log('just log me!');
return 32;
}
<root>
<child>
<grandchild>
Some text
</grandchild>
</child>
</root>
function testFunction() {
console.log('just log me!');
return 32;
}
<root>
<child>
<grandchild>
Some text
</grandchild>
</child>
</root>