Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should allow module reference as plugin #648

Closed
shakyShane opened this issue May 28, 2015 · 0 comments · May be fixed by tobybellwood/govstrap#4
Closed

Should allow module reference as plugin #648

shakyShane opened this issue May 28, 2015 · 0 comments · May be fixed by tobybellwood/govstrap#4

Comments

@shakyShane
Copy link
Contributor

Because, you'd expect this to work, but it currently doesn't

var browserSync  = require("browser-sync").create();
var htmlInjector = require("bs-html-injector");

browserSync.init({
    server: ["test/fixtures"],
    files: ["test/fixtures/css/**"],
    plugins: [htmlInjector]
});

the solution without a fix, is any of the following, which turns out to not always be appropriate.

var browserSync  = require("browser-sync").create();

browserSync.init({
    server: ["test/fixtures"],
    files: ["test/fixtures/css/**"],
    plugins: ["bs-html-injector"] // works because a string results in a require() call
});
var browserSync  = require("browser-sync").create();
var htmlInjector = require("bs-html-injector");

browserSync.init({
    server: ["test/fixtures"],
    files: ["test/fixtures/css/**"],
    plugins: [
        {
            module: "bs-html-injector", // works because of inline plugin support
            options: {}
        }
    ]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant