Skip to content

Instantly share code, notes, and snippets.

@guillegr123
Created May 30, 2020 17:07
Show Gist options
  • Save guillegr123/35c73736a4159272d820b19b8762b302 to your computer and use it in GitHub Desktop.
Save guillegr123/35c73736a4159272d820b19b8762b302 to your computer and use it in GitHub Desktop.
phoenix_preact-8-app.jsx
// Preact imports
import { h, render } from 'preact';
// App component import
import App from './components/App';
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import "../css/app.scss"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import deps with the dep name or local files with a relative path, for example:
//
// import {Socket} from "phoenix"
// import socket from "./socket"
//
import "phoenix_html"
// Inject our App component into the DOM
render(<App />, document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment