This file contains 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
let entryModified = false; | |
module.exports = { | |
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { | |
if(dev && config.entry && !entryModified) | |
{ | |
require('@babel/register')({ | |
extensions: ['.js', '.jsx', '.ts', '.tsx'] | |
}) |
This file contains 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
The MIT License (MIT) | |
Copyright (c) 2015 Justin Perry | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
This file contains 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
# Template composition with inclusion | |
Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance: | |
```html | |
<!-- home.hbs --> | |
<html> | |
<body> | |
{{> header}} | |
<p> HOME </p> | |
{{> footer}} |
This file contains 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
define(function() { | |
// Set the privately scoped object. | |
// Its properties are modified via the get / set methods returned from the module. | |
// We can keep values private by setting the 'private' part to true and set the 'value' part as the property value. | |
var helper = { | |
foo: { | |
'private': true, | |
'value': 'Private var' | |
}, | |
classes: { |
post.html.eco
used for displaying prev and next page links on your current page (static site friendly)posts.html.eco
used for displaying a content listing, that is split up onto multiple pages (requires dynamic site)- paged plugin used for splitting a document into a different pages, very neat (static site friendly)
This file contains 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
// Just do this : (and include backbone.js) | |
var Kind = function() { | |
this.initialize && this.initialize.apply(this, arguments); | |
}; | |
Kind.extend = Backbone.Model.extend | |
//Simpler | |
var Thing = function() {}; | |
Thing.extend = Backbone.Model.extend |
This file contains 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
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */ | |
/* Default font size in pixels if not overridden. */ | |
$baseFontSize: 16; | |
/* Convert PX units to EMs. | |
Ex: margin-right: pem(16); | |
*/ | |
@function pem($pxval, $base: $baseFontSize) { | |
@return #{$pxval / $base}em; |