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
import { Component, h, Prop, State, Watch } from '@stencil/core'; | |
const Constants = { | |
baseClassname: 'my-button', | |
} | |
@Component({ | |
tag: 'my-button', | |
styleUrl: 'button.scss' | |
}) |
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 definition --> | |
<template id="fancy-element-template"> | |
<style> | |
... | |
</style> | |
<div class="container"> | |
<p>Some fancy markup goes here...</p> | |
</div> | |
</template> |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
// my-component-library is the name of our made up Web Component library | |
// that we have published on npm | |
import { applyPolyfills, defineCustomElements } from 'my-component-library/loader'; | |
ReactDOM.render(<App />, document.getElementById('root')); |
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
import React from "react"; | |
import App from "next/app"; | |
import Head from "next/head"; | |
import createCache from '@emotion/cache' | |
import { CacheProvider } from '@emotion/core' | |
const cache = createCache() | |
class MyApp extends App { |
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
// Constants | |
import { SOUNDS } from './constants'; | |
// Utils | |
import { loadSound } from 'utils/load'; | |
import { IS_SAFARI, IS_IE } from 'utils/misc'; | |
class Sound { | |
constructor(options) { |
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
const cluster = require('cluster'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const critical = require('critical'); | |
const minify = require('html-minifier').minify; | |
/*** Step 01 - define pages */ | |
// Manifest is created with Webpack on build | |
const manifest = JSON.parse(fs.readFileSync('./static/bundles/manifest.json', 'utf8')); |
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
const Component = () => { | |
const states = { | |
isInit: false, | |
}; | |
const setState = (partialState = {}, callback) => { | |
if ( | |
typeof partialState !== "object" && | |
typeof partialState !== "function" && |
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
<? | |
// // Load Manifest Asset | |
$manifest = WP_DEBUG ? array('main.css' => '', 'main.js' => '') : json_decode(file_get_contents(dirname(__FILE__)."/static/manifest.json"), true); | |
/** | |
* Register Scripts(). | |
*/ | |
function register_scripts($manifest) { |
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
{ | |
"homepage.css": "1-c554ec31e68977100d81.css", | |
"homepage.js": "homepage-c554ec31e68977100d81.js", | |
"main.css": "main.7f74f1d39af13e4eef77.css", | |
"main.js": "main.7f74f1d39af13e4eef77.js" | |
} |
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
module.exports = { | |
... | |
output: { | |
... | |
chunkFilename: "[name]-[chunkhash].js", | |
} | |
} |