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
<div | |
className={{ | |
'toolbar': true, | |
'toolbar-fixed': fixed | |
}}> | |
{ children } | |
</div> |
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 flattenObj = (obj) => { | |
if (!obj) { | |
return {} | |
} | |
return Object.keys(obj).reduce((acc, curr) => { | |
const objValue = obj[curr] | |
const ret = (objValue && objValue instanceof Object) | |
? flattenObj(objValue) | |
: { [curr]: objValue } | |
return Object.assign(acc, ret) |
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
import { flattenObj } from '#JS/flatten' | |
const dynamicClasses = (obj) => { | |
if (obj && obj instanceof Object) { | |
const flatten = flattenObj(obj) | |
return Object.keys(flatten) | |
.filter(el => flatten[el]) | |
.join(' ') | |
} | |
return '' |
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
import getDynamicClasses from '#JS/dynamic-classes' | |
export default ({ children, fixed }) => { | |
return ( | |
<div | |
className={getDynamicClasses({ | |
'toolbar': true, | |
'toolbar-fixed': fixed | |
})}> | |
{ children } |
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
module.exports = merge(baseWebpackConfig, { | |
// ... | |
plugins: [ | |
new webpack.optimize.UglifyJsPlugin({ | |
sourceMap: config.build.productionSourceMap, | |
minimize: true, | |
compress: { | |
warnings: false, // warn about potentially dangerous optimizations/code | |
sequences: true, // join consecutive statemets with the “comma operator” | |
properties: true, // optimize property access: a["foo"] → a.foo |
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
module.exports = merge(baseWebpackConfig, { | |
// ... | |
plugins: [ | |
// ... | |
// Build my bundle app.js from node_modules with NO quasar code | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'vendor', | |
async: true, | |
minChunks: function (module, count) { | |
// any required modules inside node_modules are extracted to vendor |
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
var | |
// ... | |
PreloadWebpackPlugin = require('preload-webpack-plugin'), | |
// ... | |
module.exports = merge(baseWebpackConfig, { | |
// ... | |
plugins: [ | |
// ... | |
new PreloadWebpackPlugin({ |
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
var fs = require('fs') | |
var UglifyJS = require('uglify-es') | |
module.exports = function(filePath) { | |
var code = fs.readFileSync(filePath, 'utf-8') | |
var result = UglifyJS.minify(code) | |
if (result.error) return '' | |
return result.code | |
} |
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() { | |
'use strict'; | |
// Check to make sure service workers are supported in the current browser, | |
// and that the current page is accessed from a secure origin. Using a | |
// service worker from an insecure origin will trigger JS console errors. | |
const isLocalhost = Boolean(window.location.hostname === 'localhost' || | |
// [::1] is the IPv6 localhost address. | |
window.location.hostname === '[::1]' || | |
// 127.0.0.1/8 is considered localhost for IPv4. |
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
var | |
// ... | |
SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'), | |
loadMinified = require('./load-minified'), | |
// ... | |
module.exports = merge(baseWebpackConfig, { | |
// ... | |
plugins: [ | |
// ... |