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: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
loader: "awesome-typescript-loader" | |
} | |
] | |
}, |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"allowSyntheticDefaultImports": true, | |
"jsx": "react", | |
"module": "commonjs", | |
"noImplicitAny": true, | |
"outDir": "./build/", | |
"preserveConstEnums": true, | |
"removeComments": true, | |
"sourceMap": 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
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: "./index.html" | |
}) | |
] |
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: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
loader: "awesome-typescript-loader" | |
}, | |
{ | |
enforce: "pre", | |
test: /\.js$/, | |
loader: "source-map-loader" |
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 * as React from "react"; | |
export class App extends React.Component<any, any> { | |
render() { | |
return <h1>Hello, {this.props.name}</h1>; | |
} | |
} |
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 * as React from "react"; | |
import * as ReactDOM from "react-dom"; | |
import { App } from "./components/App"; | |
const ROOT = document.querySelector(".container"); | |
ReactDOM.render(<App name="Jamala" />, 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
devtool: "source-map", | |
resolve: { | |
extensions: [".js", ".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
$background-grey: #f3f3f3; | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.3rem; | |
background-color: $background-grey; | |
} |
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
{ | |
test: /\.scss$/, | |
use: ExtractTextPlugin.extract({ | |
use: [ | |
{ | |
loader: "css-loader", | |
options: { | |
minimize: 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
/** | |
* Creates an anchor element `<a></a>` with | |
* the base64 pdf source and a filename with the | |
* HTML5 `download` attribute then clicks on it. | |
* @param {string} pdf | |
* @return {void} | |
*/ | |
function downloadPDF(pdf) { | |
const linkSource = `data:application/pdf;base64,${pdf}`; | |
const downloadLink = document.createElement("a"); |