@sample_test/di-loader-test
di-loader
Last updated 3 years ago by viatorus .
ISC · Original npm · Tarball · package.json
$ cnpm install @sample_test/di-loader-test 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.1.1                                ...           latest (3 years ago)

1 Versions

  • 2.1.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |