Skip to content

Import form node_modules into dist folder #140

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

Closed
zimexco opened this issue Jan 13, 2016 · 4 comments
Closed

Import form node_modules into dist folder #140

zimexco opened this issue Jan 13, 2016 · 4 comments

Comments

@zimexco
Copy link

zimexco commented Jan 13, 2016

Hi! I want to use bootstrap v4 with my project generated by angular-cli, but I can't find a way to import the bootstrap folder downloaded with npm inside dist/vendor .
How can I do?

Thank's

@zimexco zimexco changed the title Import node_modules into dist folder Import form node_modules into dist folder Jan 13, 2016
@EmmanuelDemey
Copy link
Contributor

I think you can not, because the files imported in the vendor directory is hard-coded. Cf this file https://github.com/angular/angular-cli/blob/master/lib/broccoli/angular2-app.js

Am I wrong ?

Maybe we can do the same thing as wiredep ? read the main property of each NPM modules, and copy/paste these files in the vendor dir ?

@intellix
Copy link
Contributor

If you want to quickly solve this, have this ember-cli-build.js:

/* global require, module */

var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');

module.exports = function(defaults) {
    var app = new Angular2App(defaults);
    var app = app.toTree();

    var vendors = new Funnel('node_modules', {
        include: [
            'bootstrap/scss/**/*'
        ],
        destDir: 'vendor'
    });

    return mergeTrees([app, vendors], { overwrite: true });
}

@cironunes
Copy link
Member

Closed by acaaa3e and 2efc9a1

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants