2.1.1 • Published 7 years ago

di-loader v2.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

di-loader

Dependency Injection webpack bundler

Installation

npm i -S di-loader

Usage

First add plugin to the list of webpack's plugins.

// webpack.config.js
const ExtractDIPlugin = require('extract-di-webpack-plugin');

module.exports = {
    // ...
    plugins: [
        // ...
        new DILoaderPlugin({
            src: [
                './src/js/collections',
                './src/js/components',
                './src/js/models',
                './src/js/states'
            ],
            filter(filepath) {
                return !~filepath.indexOf('Spec');
            }
        }),
    ]

 }

After that you can use suitable loaders to access dependencies, resolvers and container.

// entry.js
import dependencies from 'di-loader/dependencies!./client'; // dependencies hashmap
import resolvers from 'di-loader/resolvers!./client'; // resolvers hashmap
import resolvers from 'di-loader/container!./client'; // configured di container
2.1.1

7 years ago

2.1.0

7 years ago

1.0.6

7 years ago

2.0.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago