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
| const browserify = require('browserify'); | |
| const fs = require('fs'); | |
| const hbsfy = require("hbsfy"); | |
| const treeshake = require('common-shakeify') | |
| const factor = require('factor-bundle'); | |
| const path = require('path'); | |
| browserify({ | |
| entries: [ path.resolve('app/main.js'), path.resolve('app/another-entry.js') ], | |
| paths: [ './node_modules','./app' ], |
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
| function deepFreeze(obj) { | |
| return Object.entries(obj).reduce((result, [name, value]) => { | |
| Object.freeze(result); | |
| result[name] = value && value !== null && typeof value === 'object' ? deepFreeze(value) : value; | |
| return result; | |
| }, obj); | |
| } |
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
| function qs(selector, callback, context) { | |
| if(callback === undefined) return; | |
| context = context || document; | |
| const result = context.querySelector(selector); | |
| if(result) { | |
| return callback(result); | |
| } | |
| } | |
| qs('.some .selector', (safeElement) => { |
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
| rm -rf node_modules/ && rm -rf bower_components/; | |
| npm cache clean && bower cache clean; | |
| npm install && bower install; |