2.2.5 • Published 2 years ago

@pota/webpack-skeleton v2.2.5

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

webpack-skeleton downloads

Setup 🚀

You can create a new project using the @pota/create package.

npx @pota/create webpack my-webpack-app

Standards 📒

This project follows the MediaMonks Frontend Coding Standards

Features 🔋

Pota Commands

build - builds the source using webpack.

npm run build # or npx pota build
OptionTypeDefaultDescription
analyze{Boolean}falseWhen enabled, will open a bundle report after bundling.
cache{Boolean}trueToggles webpack's caching behavior.
image-compression{Boolean}trueToggles image compression.
debug{Boolean}falseSets NODE_ENV to 'development'.
watch{Boolean}falseRun build and watch for changes.
output{String}./distThe build output directory.
source-map{false\|devtool}source-map (production), eval-source-map (development)Sets the style of source-map, for enhanced debugging. Disable or use faster options in you are having out of memory or other performance issues.
public-path{String}/The location of static assets on your production server.
typecheck{Boolean}trueWhen disabled, will ignore type related errors.
versioning{Boolean}falseWhen enabled, will copy assets in ./static to a versioned directory in the output (e.g. build/version/v2/static/...).

dev - starts the development service using webpack-dev-server.

npm run dev # or npx pota dev
OptionTypeDefaultDescription
cache{Boolean}trueToggle webpack's caching behavior.
https{Boolean}falseRun the development server with HTTPS.
open{Boolean}trueAllows to configure dev server to open the browser after the server has been started.
port{Number}2001Allows configuring the port.
image-compression{Boolean}trueToggles image compression.
prod{Boolean}falseSets NODE_ENV to 'production'.
source-map{false\|devtool}source-map (production), eval-source-map (development)Sets the style of source-map, for enhanced debugging. Disable or use faster options in you are having out of memory or other performance issues.
typecheck{Boolean}trueToggles checking for type related errors.

hidden TODOs

Scripts

Non-Pota scripts defined in "scripts" of package.json and are runnable using npm run {script}

ScriptDescription
typecheckChecks for type errors and unused variables/types in the source directory.
fixExecutes all fix:* and `format commands in sequence.
fix:eslintExecutes eslint:lint and fixes fixable errors.
formatFormats the source files using prettier.
lintExecutes all lint:* commands in sequence.
lint:eslintLints the source files using eslint.
rsyncSynchronizes (uploads) dist/ files to a remote server.

JavaScript / TypeScript

hidden TODOs

CSS

hidden TODOs

Images

hidden TODOs

Misc. Assets

hidden TODOs

Linting & Formatting

hidden TODOs

Service Worker

The skeleton has opt-in support for service workers through the help of workbox.

To get started, you can create /src/service-worker.ts file to customize workbox and its many modules .

This is how an example service worker file could look like:

/// <reference lib="webworker" />

import { clientsClaim } from 'workbox-core';
import { precacheAndRoute } from 'workbox-precaching';

declare const self: ServiceWorkerGlobalScope;

clientsClaim();

// eslint-disable-next-line no-underscore-dangle
precacheAndRoute(self.__WB_MANIFEST);

Now, whenever you bundle your application for production, a service-worker.js file will be generated.

As a last step, you need to make sure to register the service worker using the serviceWorkerRegistration.ts module, see the comment in main.ts for more details.

Deployment

Remote Sync

For simple deployments, when you just want to upload your files to a remote server, you can use the rsync script.

Note: before using the rsync script, make sure to configure a host in in the "package.json"

npm pkg set config.host="github.com"

hidden TODOs

Git

hidden TODOs

Continuous Integration / Continuous Deployment

Bitbucket

webpack-skeleton comes with bitbucket-pipelines.yml, pre-configured to run check-types, lint and test scripts.

hidden TODOs

2.2.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

1.0.0-rc.46

2 years ago

2.2.4

2 years ago

1.0.0-rc.45

2 years ago

1.0.0-rc.44

2 years ago

1.0.0-rc.47

2 years ago

2.0.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

1.0.0-rc.42

2 years ago

1.0.0-rc.41

2 years ago

1.0.0-rc.40

2 years ago

1.0.0-rc.43

2 years ago

1.0.0-rc.17

3 years ago

1.0.0-rc.16

3 years ago

1.0.0-rc.19

3 years ago

1.0.0-rc.18

3 years ago

1.0.0-rc.20

3 years ago

1.0.0-rc.24

3 years ago

1.0.0-rc.23

3 years ago

1.0.0-rc.22

3 years ago

1.0.0-rc.21

3 years ago

1.0.0-rc.28

2 years ago

1.0.0-rc.27

3 years ago

1.0.0-rc.26

3 years ago

1.0.0-rc.25

3 years ago

1.0.0-rc.29

2 years ago

1.0.0-rc.31

2 years ago

1.0.0-rc.30

2 years ago

1.0.0-rc.35

2 years ago

1.0.0-rc.34

2 years ago

1.0.0-rc.33

2 years ago

1.0.0-rc.32

2 years ago

1.0.0-rc.39

2 years ago

1.0.0-rc.38

2 years ago

1.0.0-rc.37

2 years ago

1.0.0-rc.36

2 years ago

1.0.0-rc.15

3 years ago

1.0.0-rc.13

3 years ago

1.0.0-rc.14

3 years ago

1.0.0-rc.12

3 years ago

1.0.0-rc.11

3 years ago

1.0.0-rc.10

3 years ago

1.0.0-rc.9

3 years ago

1.0.0-rc.7

3 years ago

1.0.0-rc.8

3 years ago

1.0.0-rc.6

3 years ago

1.0.0-rc.5

3 years ago

1.0.0-rc.4

3 years ago

1.0.0-rc.3

3 years ago

0.1.0

3 years ago

0.1.0-alpha.7

3 years ago

0.1.0-alpha.6

3 years ago

1.0.0-rc.1

3 years ago

1.0.0-rc.2

3 years ago

0.1.0-alpha.5

3 years ago

0.1.0-alpha.4

3 years ago

0.1.0-alpha.3

3 years ago

0.1.0-alpha.2

3 years ago

0.1.0-alpha.1

3 years ago