This file contains hidden or 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 glob = require('glob'); | |
const fs = require('fs'); | |
const dest = 'dist/sw.js'; | |
const staticAssetsCacheName = 'todo-assets-v1'; | |
const dynamicCacheName = 'todo-dynamic-v1'; | |
let staticAssetsCacheFiles = glob | |
.sync('dist/**/*') | |
.map((path) => { |
This file contains hidden or 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 = { | |
entry: { | |
// Mention Entry File | |
}, | |
output: { | |
// Mention Output Filenames | |
}, | |
module: { | |
rules: [ | |
{ |
This file contains hidden or 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 WorkModel = [ | |
{ | |
id: 1, | |
src: '', | |
alt: '', | |
designation: '', | |
period: '', | |
description: '' | |
}, | |
{ |
This file contains hidden or 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 = { | |
entry: { | |
// Mention Entry File | |
}, | |
output: { | |
// Mention Output Filenames | |
}, | |
module: { | |
rules: [ | |
{ |
This file contains hidden or 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
{ | |
"presets": ["@babel/preset-env"], | |
"plugins": ["@babel/plugin-syntax-dynamic-import"] | |
} |
This file contains hidden or 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 path = require('path'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const WebpackMd5Hash = require('webpack-md5-hash'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const CompressionPlugin = require('compression-webpack-plugin'); | |
module.exports = (env, argv) => ({ | |
entry: { |
This file contains hidden or 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
{ | |
"name": "vanilla-todos-pwa", | |
"version": "1.0.0", | |
"description": "A simple todo application using ES6 and Webpack", | |
"main": "src/main.js", | |
"scripts": { | |
"build": "webpack --mode production && node build-sw", | |
"serve": "webpack-dev-server --mode=development --hot" | |
}, | |
"keywords": [], |
This file contains hidden or 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
export const appTemplate = model => ` | |
<section class="app"> | |
<h3> ${model.title} </h3> | |
<section class="button"> | |
<button class="btn-todo"> Todo Module </button> | |
</section> | |
</section> | |
`; |
This file contains hidden or 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 { appTemplate } from './app.template'; | |
import { AppModel } from './app.model'; | |
export const AppComponent = { | |
init() { | |
this.appElement = document.querySelector('#app'); | |
this.initEvents(); | |
this.render(); | |
}, |
This file contains hidden or 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 { appTemplate } from './app.template'; | |
import { AppModel } from './app.model'; | |
export const AppComponent = { | |
// App Component code here... | |
}; |
NewerOlder