WebpackWrap - JS/TS Webpack Build Wrapper

homeproject idproject typeproject langwebpack-wrapapp-publishereslint-utils

vcslatest releaseprod pipeline status

Description

The main purpose of this package is to provide a convenient interface for webpack builds acrosss projects.

Requirements

  • NodeJs >= 16.20
  • NPM >= 8

Installation

It is reccomended to install install webpack-wrap globally. To install globally, run the following command:

npm install -g @spmhome/webpack-wrap

To install for a single project, run the following command from the directory containing the projects package.json file:

npm install --save-dev @spmhome/webpack-wrap

Screenshots

Example Compilation ResultsExample Compilation Results
ss0ss1
Example Compilation ResultsExample Compilation Results
ss0ss1

Configuration File

The filename .wpwrc.* is recognized as the configuration file. The cosmicconfig package is used to manage the configuration. therefore the config file can be written in any format supported by the cosmicconfig package. The supported and recommended format is JSON, i.e. .wpwrc.json.

TODO

Visual Studio Code Extension

Coming soon!
TODO

src/bin/cli-options.js

src/bin/wpw-cli.js

bim/wpw-cli.js

Author
  • Scott Meesseman @spmeesseman

src/core/base.js

src/core/base.js

Author
  • Scott Meesseman @spmeesseman

src/core/build.js

main class representing a build that produces output assets
.-. .-. .;;;;. .-. .-.
.;. .-. () )-. .;. .-. () )-. .;. .-. ' .;' ;' (_) (_) )-.; ;' .: \ ; ;' .: __) ;; ; .;' .:' .: \ ;; ; .:' ) ;; ; .:'. ;; : .;' .:' .:'
;; ; ;; .-:. --' ;; ; ;; :' ) ;; ; .;' .-:. .-. .-:. );.' .;' (_/;.' .;' (_/----' ;.__.: .;;;;;;;;;' (_/;.. (/ `----'

Author
  • Scott Meesseman @spmeesseman

src/core/module.js

core/module.js

Author
  • Scott Meesseman @spmeesseman

src/core/options.js

services/options.js

Author
  • Scott Meesseman @spmeesseman

src/core/script.js

External script wrapper

Author
  • Scott Meesseman @spmeesseman

src/core/source.js

core/source.js

Author
  • Scott Meesseman @spmeesseman

src/core/wrapper.js

src/core/wrapper.js

Author
  • Scott Meesseman @spmeesseman

src/exports/base.js

src/exports/cache.js

src/exports/devtool.js

exports/devtool.js

Author
  • Scott Meesseman @spmeesseman
See
  • href="https:%5C/%5C/webpack.js.org/configuration/devtool">webpack.js.org/experiments

    Adds library mode webpack config output object.

    Possible devTool values:

    none:                        : Recommended for prod builds w/ max performance
    inline-source-map:           : Possible when publishing a single file
    cheap-source-map
    cheap-module-source-map
    eval:                        : Recommended for dev builds w/ max performance
    eval-source-map:             : Recommended for dev builds w/ high quality SourceMaps
    eval-cheap-module-source-map : Tradeoff for dev builds
    eval-cheap-source-map:       : Tradeoff for dev builds
    inline-cheap-source-map
    inline-cheap-module-source-map
    source-map:                  : Recommended for prod builds w/ high quality SourceMaps
    

src/exports/entry.js

src/exports/experiments.js

exports/experiments.js

Author
  • Scott Meesseman @spmeesseman
See
  • href="https:%5C/%5C/webpack.js.org/configuration/experiments">webpack.js.org/experiments

src/exports/externals.js

@see href="https:%5C/%5C/webpack.js.org/configuration/externals/">externals

Author
  • Scott Meesseman @spmeesseman

src/exports/ignore.js

exports/ignore.js

Author
  • Scott Meesseman @spmeesseman
See
  • href="https:%5C/%5C/webpack.js.org/configuration/ignorewarnings">webpack.js.org/experiments

src/exports/index.js

src/exports/infrastructure.js

src/exports/optimization.js

src/exports/output.js

src/exports/output.js

Author
  • Scott Meesseman @spmeesseman
See
  • href="https:%5C/%5C/webpack.js.org/configuration/output">webpack.js.org/output

src/exports/plugin.js

src/exports/plugins.js

src/exports/resolve.js

src/exports/rules.js

src/exports/stats.js

src/exports/watch.js

exports/watch.js

Author
  • Scott Meesseman @spmeesseman
See
  • href="https:%5C/%5C/webpack.js.org/configuration/watch">webpack.js.org/experiments

src/loaders/wpw-task-loader/lib/task.js

src/log/log.js

lib/log/log.js

Author
  • Scott Meesseman @spmeesseman

src/log/wpconsole.js

src/plugins/analyze/analyzer.js

src/plugins/analyze/base.js

src/plugins/analyze/circular.js

src/plugins/analyze/hooks.js

src/plugins/analyze/progress.js

src/plugins/analyze/stats.js

src/plugins/analyze/visualizer.js

src/plugins/base.js

Base WpwPlugin abstract class inherited by all plugin-type modules

When adding a new extending plugin:

Follow naming convention. All plugins and schema/configuration properties must be named using the folowing format:

  class name       : WpwPluginNamePlugin
  config property  : WpwPluginConfigPluginName

For example, a plugin named ReplaceStrings:

  class name       : WpwReplaceStringsPlugin
  config property  : WpwPluginConfigReplaceStrings

Perform the following tasks:

1. Adjust the schema file by adding the plugin name to relevant areas, and adding a
   new config definition object if required / used, otherwise add the configuration
   property and reference `WpwPluginConfigBase` as the config

   file:///./../../schema/spmh.wpw.schema.json

2. Run the `generate-rc-types` script / npm task to rebuild rc.ts definition file

   file:///./../../script/generate-rc-types.js

       run: @te::task::npm:schema-generate-rc-types@

3. Add a module reference to plugin directory index file and add to it's module.exports

   file:///./index.js
Author
  • Scott Meesseman @spmeesseman

src/plugins/basemerge.js

src/plugins/basetask.js

Base abstract plugin for builds that do not produce a "module" as per what webpack is basically
designed for, but for a "task build", such as a types package or jsdoc packaging task. Typical
tasks that might usually be done by a task runner such as Gulp, Grunt, Ant, etc...

The concept is to use a "fake" or virtual file as the entry point so that the webpack process
runs as it would normally. The virtual file is removed during compilation while the output of
the specific task is added and emitted in the (probably) 'process_additional_assets' stage.

Author
  • Scott Meesseman @spmeesseman

src/plugins/cleanup/clean.js

src/plugins/cleanup/dispose.js

src/plugins/copy.js

src/plugins/doc/base.js

src/plugins/doc/doxygen.js

src/plugins/doc/extjs.js

src/plugins/doc/jsdoc.js

src/plugins/hash.js

src/plugins/ignore.js

src/plugins/index.js

src/plugins/release/ap.js

src/plugins/release/banner.js

src/plugins/release/infoproj.js

src/plugins/release/iso.js

src/plugins/release/licensefiles.js

src/plugins/release/npmiso.js

src/plugins/release/pwa.js

src/plugins/release/scm.js

src/plugins/release/typesiso.js

src/plugins/release/upload.js

plugin/upload.js
!!! This module uses 'plink' and 'pscp' from the PuTTY package: https://www.putty.org
!!! For first time build on fresh os install:
!!! - create the environment variables WPW_APP3_SSH_AUTH_*
!!! - run a plink command manually to generate and trust the fingerprints:
!!! plink -ssh -pwsmeesseman@app3.spmeesseman.com "echo hello"
!!! plink -ssh -batch -pwubuntu@app3.spmhome.io "echo hello"

Author
  • Scott Meesseman @spmeesseman

src/plugins/release/vsceiso.js

src/plugins/resource.js

src/plugins/rollup.js

src/plugins/runtimevars.js

src/plugins/schema.js

src/plugins/script/runscripts.js

src/plugins/script/script.js

src/plugins/shebang.js

src/plugins/shebang.js

Version
  • 0.0.1
Author
  • Scott Meesseman @spmeesseman

src/plugins/ts/dtsbundle.js

src/plugins/ts/program.js

src/plugins/ts/sourcemaps.js

src/plugins/ts/tscheck.js

src/plugins/ts/types.js

src/plugins/wait.js

src/plugins/wait.js

Author
  • Scott Meesseman @spmeesseman

src/plugins/web/html.js

base class for spa and mpa webapp or webworker

Author
  • Scott Meesseman @spmeesseman

src/plugins/web/inlinechunks.js

Base WpwPlugin abstract class inherited by all plugin-type modules

Author
  • Scott Meesseman @spmeesseman

src/scripts/create-new-plugin.js

src/services/base.js

src/services/cache.js

src/services/snapshot.js

src/services/tsc.js

src/services/tsc/language.js

src/utils/global.js

src/utils/hook.js

plugin/exec.js

Author
  • Scott Meesseman @spmeesseman\

src/utils/print.js

src/utils/print.js

Author
  • Scott Meesseman @spmeesseman

src/utils/regex.js

utils/regex.js

Author
  • @spmeesseman Scott Meesseman

src/utils/utils.js

utils/utils.js

Author
  • Scott Meesseman @spmeesseman

src/utils/vendormod.js