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
... | |
render() { | |
const { openedMenu, onOpenMenu, state } = this.props; | |
return <button | |
id="menu-hamburger" | |
aria-controls="menu-mobile" | |
aria-expanded={openedMenu} | |
aria-haspopup={true} |
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 devServer = {}; | |
const webpack = require("webpack"); | |
const ENV = process.env.NODE_ENV === "production" ? "production" : "development"; | |
const outputPath = | |
ENV === "production" | |
? path.resolve(__dirname + "../../static/") | |
: path.resolve(__dirname + "/dist/"); |
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
<? | |
function register_scripts() { | |
// include the base style in the header. | |
$base_js = WP_DEBUG ? 'http://localhost:8080/bundle.js' : get_stylesheet_directory_uri() . ( '/static/app.js' ); | |
wp_register_script( | |
'base-script', // handle name. | |
$base_js, | |
null, // an array of dependent styles. |
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 Turbolinks from "turbolinks"; | |
Turbolinks.start(); | |
// When you just clicked on a link | |
document.addEventListener("turbolinks:before-visit", e => { | |
... | |
}); | |
// When the transition is happening |
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 currentView = null; | |
const pageLoaded = () => { | |
// "Routing" | |
const currentPage = document.querySelector("#content").firstElementChild; | |
switch (currentPage.id) { | |
case "home-page": | |
import(/* webpackChunkName: "homepage" */ "pages/homepage/homepage") | |
.then(currentViewImported) |
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 "scss/partials/pages/_homepage.scss"; | |
export default class Homepage { | |
... | |
} |
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", | |
} | |
} |
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
<? | |
// // 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) { |