# export-a-single-library-module-automatically-with-webpack

> Export a single library module automatically with Webpack

Latest version **1.0.0** (published 2019-03-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install export-a-single-library-module-automatically-with-webpack
pnpm add export-a-single-library-module-automatically-with-webpack
yarn add export-a-single-library-module-automatically-with-webpack
bun add export-a-single-library-module-automatically-with-webpack
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-03-14 |
| First published | 2019-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 52.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Takuya Motoshima |
| Maintainers | takuya-motoshima |
| Keywords | webpack, sample, examples, guide |

## Links

- npm: https://www.npmjs.com/package/export-a-single-library-module-automatically-with-webpack
- Repository: https://github.com/takuya-motoshima/export-a-single-library-module-automatically-with-webpack
- Homepage: https://github.com/takuya-motoshima/export-a-single-library-module-automatically-with-webpack#readme
- Issues: https://github.com/takuya-motoshima/export-a-single-library-module-automatically-with-webpack/issues
- npm.io page: https://npm.io/package/export-a-single-library-module-automatically-with-webpack

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) ^3.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-03-14

## README

# Export a single library module automatically with Webpack

## Setting up the environment

### Install the dependencies

```
npm install
```

### Creating a Bundle of library

```
npx webpack
```

## Directory structure
```
.
├── dist/                   # The folder in which webpack packages the built version of library.
│   ├── sample.sub1.Bar.js
│   ├── sample.sub1.Bar.js
│   ├── sample.sub2.Baz.js
│   └── sample.sub2.Qux.js
├── src/                    # The folder in which all of library source.
│   ├── sub1/               # Namespace of myLib.sub1
│   │   ├── Bar.js          # Bar class module
│   │   └── Foo.js          # Foo class module
│   └── sub2/               # Namespace of myLib.sub2
│       ├── Baz.js          # Baz class module
│       └── Qux.js          # Qux class module
├── example/                # Example of working library
├── webpack.config.js       # Configuration file that webpack uses to build library
└── package.json            # Configuration file for Project metadata, dependencies and build scripts
```


## Work Example

### Creating a Bundle of example

```
cd ./example
../node_modules/webpack/bin/webpack.js
```

Open [./example/index.html](./example/index.html) in the browser and check with the console

### Example source code

```
import Foo from 'sample.sub1.Foo';
import Bar from 'sample.sub1.Bar';
import Baz from 'sample.sub2.Baz';
import Qux from 'sample.sub2.Qux';

print(Foo.name());
print(Bar.name());
print(Baz.name());
print(Qux.name());

function print(str) {
  const p = document.createElement('p');
  p.textContent = str;
  document.body.appendChild(p);
}
```

---
_Source: https://npm.io/package/export-a-single-library-module-automatically-with-webpack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
