Skip to content

Instantly share code, notes, and snippets.

View rowanoulton's full-sized avatar

Rowan Oulton rowanoulton

View GitHub Profile
{
0: "d4920286de51402132dc", /* ← hash for the application bundle */
1: "29a3cf9344f1503c9f8f",
2: "e22b11ab6e327c7da035",
/* .. and so on ... */
}
new UglifyJsPlugin({
uglifyOptions: {
compress: {
arrows: false,
booleans: false,
cascade: false,
collapse_vars: false,
comparisons: false,
computed_props: false,
hoist_funs: false,
const CrudeTimingPlugin = require('./crude-timing-plugin');
module.exports = {
plugins: [
new CrudeTimingPlugin(),
new UglifyJSPlugin(),
]
};
@rowanoulton
rowanoulton / crude-timing-plugin.js
Created January 16, 2018 17:28
A webpack plugin that crudely measures the execution time of UglifyJSPlugin
let CrudeTimingPlugin = function() {};
CrudeTimingPlugin.prototype.apply = function(compiler) {
compiler.plugin('compilation', (compilation) => {
let startOptimizePhase;
compilation.plugin('optimize-chunk-assets', (chunks, callback) => {
// Cruddy way of measuring minification time. UglifyJSPlugin does all
// its work in this phase of compilation so we time the duration of
// the entire phase
const CrudeTimingPlugin = require('./crude-timing-plugin');
{
plugins: [
new CrudeTimingPlugin(),
],
}
let CrudeTimingPlugin = function() {};
CrudeTimingPlugin.prototype.apply = function(compiler) {
compiler.plugin('compilation', (compilation) => {
let startOptimizePhase;
compilation.plugin('optimize-chunk-assets', (chunks, callback) => {
// Cruddy way of measuring minification time. UglifyJSPlugin does all
// its work in this phase of compilation so we time the duration of
// the entire phase
node --inspect ./node_modules/.bin/webpack
# spec/rails_helper.rb
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
# Gemfile
group :test do
gem 'database_cleaner'
end
# .travis.yml
services:
- elasticsearch
before_script:
- sleep 5 # To make sure Elasticsearch instance is ready