0.9.75 • Published 4 years ago

webpack-bundle v0.9.75

Weekly downloads
269
License
MIT
Repository
github
Last release
4 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

4 years ago

0.9.74

4 years ago

0.9.73

4 years ago

0.9.72

4 years ago

0.9.71

4 years ago

0.9.70

4 years ago

0.9.67

4 years ago

0.9.68

4 years ago

0.9.69

4 years ago

0.9.66

4 years ago

0.9.65

4 years ago

0.9.64

4 years ago

0.9.63

4 years ago

0.9.62

4 years ago

0.9.61

4 years ago

0.9.60

4 years ago

0.9.59

4 years ago

0.9.58

4 years ago

0.9.57

5 years ago

0.9.56

5 years ago

0.9.55

5 years ago

0.9.54

5 years ago

0.9.52

5 years ago

0.9.53

5 years ago

0.9.51

5 years ago

0.9.50

5 years ago

0.9.49

5 years ago

0.9.48

5 years ago

0.9.47

5 years ago

0.9.46

5 years ago

0.9.45

5 years ago

0.9.44

5 years ago

0.9.43

5 years ago

0.9.42

5 years ago

0.9.41

5 years ago

0.9.40

5 years ago

0.9.39

6 years ago

0.9.38

6 years ago

0.9.37

6 years ago

0.9.36

6 years ago

0.9.35

6 years ago

0.9.34

6 years ago

0.9.33

6 years ago

0.9.32

6 years ago

0.9.31

6 years ago

0.9.30

6 years ago

0.9.29

6 years ago

0.9.28

6 years ago

0.9.27

6 years ago

0.9.26

6 years ago

0.9.25

6 years ago

0.9.24

6 years ago

0.9.23

6 years ago

0.9.22

6 years ago

0.9.21

6 years ago

0.9.20

6 years ago

0.9.19

6 years ago

0.9.18

6 years ago

0.9.17

6 years ago

0.9.16

6 years ago

0.9.15

6 years ago

0.9.14

6 years ago

0.9.13

6 years ago

0.9.12

6 years ago

0.9.11

6 years ago

0.9.10

6 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago