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
"scripts": { | |
"dev": "webpack-dev-server --mode=development --open", | |
"build": "webpack --mode=development", | |
"release": "webpack" | |
} |
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 = { | |
... | |
module: { | |
rules: [ | |
... | |
{ | |
test: /\.(png|jpg|gif)$/, | |
use: { |
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: { | |
... | |
publicPath: "/" | |
}, | |
... | |
}; |
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 log(message) { | |
console.log(message); | |
} | |
export function add(x, y) { | |
log(`Adding ${x} to ${y}`); | |
return x + y; | |
} |
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 "./assets/css/global.css"; | |
import * as math from "./math"; | |
let addition = math.add(5, 6); | |
let subtraction = math.subtract(10, 20); | |
console.log(addition); | |
console.log(subtraction); | |
console.log(math.pi); |
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 HtmlWebpackPlugin = require("html-webpack-plugin"); | |
module.exports = { | |
module: { | |
... | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: './src/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
Last known cursor location was: <span id="span-location"></span> |
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
observable.subscribe({ | |
next: callback, | |
error: callback, | |
complete: callback | |
}); |
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
observable.subscribe(next, error, complete); |
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 { fromEvent } from "rxjs"; | |
let span = document.querySelector("#span-location"); | |
fromEvent(document, "mousemove") | |
.subscribe((e) => { | |
span.innerHTML = `X: ${e.clientX} - Y: ${e.clientY}`; | |
}); |