0.9.75 • Published 3 years ago

webpack-bundle v0.9.75

Weekly downloads
269
License
MIT
Repository
github
Last release
3 years ago

webpack-bundle

The package helps to generate a webpack configuration and predefined bundles/options or both.

Build Status Coverage Status Greenkeeper badge

Getting starting

Install the package via npm or yarn

yarn add --dev webpack-bundle

or

npm i -D webpack-bundle

The package provide a simple API to define configuration. See a how-to example:

// webpack.config.ts
import {Bundle, Options} from "webpack-bundle";

const config = new Bundle();
config.set(
    new Options.Mode("production"),
    new Options.Module(/* module options */),
    new Options.Optimization(/* optimization options */),
    // ... another options
);

export default config.getWebpackConfig();

How to use TypeScript as a configuration language you can read here.

API

Full API documentation now available in source code only.

Custom Options

You can use custom (predefined) options like this:

// MySPAModule.ts
import {Options, Loader} from "webpack-bundle";

export class MySPAModule extends Options.Module {
    constructor() {
        super([
            new Loader({test: /\.tsx?$/, loader: "ts"}),
            new Loader({test: /\.css?$/, loader: "style"}),
            // add some more loaders...
        ]);
    }
}

use:

// webpack.config.ts
import {Bundle} from "webpack-bundle";
import {MySPAModule} from "./MySPAModule";

const bundle = new Bundle(
    new MySPAModule()
);

export default bundle.getWebpackConfiguration();

Custom Bundle

Write your bundles to your taste or like this:

// MySPABundle.ts
import {Bundle, Options, Loader} from "webpack-bundle";

export class MySPABundle extends Bundle {
    constructor() {
        super(
            new Options.Mode("development"),
            new Options.Module([
                new Loader({
                    test: /\.tsx?$/,
                    loader: "ts",
                    options: {
                        transpileOnly: true
                    }
                }),
            ]),
            // some other options...
        );
    }
}

use:

// webpack.config.ts

import {MySPABundle} from "./MySPABundle";

const bundle = new MySPABundle();
export default bundle.getWebpackConfiguration();
0.9.75

3 years ago

0.9.74

3 years ago

0.9.73

3 years ago

0.9.72

3 years ago

0.9.71

3 years ago

0.9.70

3 years ago

0.9.67

3 years ago

0.9.68

3 years ago

0.9.69

3 years ago

0.9.66

3 years ago

0.9.65

3 years ago

0.9.64

3 years ago

0.9.63

3 years ago

0.9.62

3 years ago

0.9.61

3 years ago

0.9.60

3 years ago

0.9.59

3 years ago

0.9.58

3 years ago

0.9.57

3 years ago

0.9.56

3 years ago

0.9.55

4 years ago

0.9.54

4 years ago

0.9.52

4 years ago

0.9.53

4 years ago

0.9.51

4 years ago

0.9.50

4 years ago

0.9.49

4 years ago

0.9.48

4 years ago

0.9.47

4 years ago

0.9.46

4 years ago

0.9.45

4 years ago

0.9.44

4 years ago

0.9.43

4 years ago

0.9.42

4 years ago

0.9.41

4 years ago

0.9.40

4 years ago

0.9.39

4 years ago

0.9.38

4 years ago

0.9.37

5 years ago

0.9.36

5 years ago

0.9.35

5 years ago

0.9.34

5 years ago

0.9.33

5 years ago

0.9.32

5 years ago

0.9.31

5 years ago

0.9.30

5 years ago

0.9.29

5 years ago

0.9.28

5 years ago

0.9.27

5 years ago

0.9.26

5 years ago

0.9.25

5 years ago

0.9.24

5 years ago

0.9.23

5 years ago

0.9.22

5 years ago

0.9.21

5 years ago

0.9.20

5 years ago

0.9.19

5 years ago

0.9.18

5 years ago

0.9.17

5 years ago

0.9.16

5 years ago

0.9.15

5 years ago

0.9.14

5 years ago

0.9.13

5 years ago

0.9.12

5 years ago

0.9.11

5 years ago

0.9.10

5 years ago

0.9.9

5 years ago

0.9.8

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.2

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago