https://github.com/fergiemcdowall/webpack-module-example
Example of javascript module compiled with webpack that can then be used with node, frontend bundles, and <script> tags
https://github.com/fergiemcdowall/webpack-module-example
modules webpack
Last synced: 2 months ago
JSON representation
Example of javascript module compiled with webpack that can then be used with node, frontend bundles, and <script> tags
- Host: GitHub
- URL: https://github.com/fergiemcdowall/webpack-module-example
- Owner: fergiemcdowall
- Created: 2020-10-30T15:38:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-08T07:51:15.000Z (over 5 years ago)
- Last Synced: 2025-03-26T19:15:51.528Z (over 1 year ago)
- Topics: modules, webpack
- Language: JavaScript
- Homepage:
- Size: 269 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webpack-module-example
This is an example module that will be used as a proof-of-concept to
develop a compilation and publishing strategy for the `search-index`
module.
## Aims
This repo contains the source code for a module that contains the
`level` dependency. Additionally this repo contains build scripts to
publish the module in various formats. The aim of this module is to
genarate:
* A version of the module that runs in node
* A version of the module that runs as a standalone js file that can
be invoked from a `` tag
* A version of the module that can be compiled into a runnable web
bundle
* A suite of tests that can be run in node
* A suite of tests that can be run in the browser
## Requirements
The code needs to be able to handle the `level` library
## Contraints
The source code is written in the "ES6 module" style, since this is
currenyly the most future-proof way to author modules.
### Bundlers
## Build strategy
### A version of the module that runs in node
This will be non-compiled. The node-version is essentially the raw
source of the module.
### A version of the module that runs as a standalone js file that can
be invoked from a <script> tag
This is compiled from the source code using webpack
### A version of the module that can be compiled into a runnable web bundle
This is compiled from the source code using webpack
### A suite of tests that can be run in node
### A suite of tests that can be run in the browser