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

funnel is copying the entire folder instead of a single file #103

Open
danielo515 opened this issue Apr 30, 2018 · 2 comments
Open

funnel is copying the entire folder instead of a single file #103

danielo515 opened this issue Apr 30, 2018 · 2 comments

Comments

@danielo515
Copy link

Hello,

I'm using the latest version of broccoli funnel 2.0.1, along with 1.2.0, which is being used by babel-transpiler:

├─┬ broccoli-babel-transpiler@6.1.4
│ └── broccoli-funnel@1.2.0

I am having problems selecting single files. This is my configuration:

const info = new Funnel(appRoot, {
    files: ["plugin.info", 'styles/tiddlywiki.files'],
    annotation: "Metadata files",
});

As you can see, I only want to copy two files, however funnel is copying all the files that are on the folder, producing big problems to me. One of the problems is that I can not merge trees unless I specify the option overwrite to true.
Is this a bug with the latest version or may be a problem with babel-transpiler ?

Here is how I have the merge trees, and js configured:

const info = new Funnel(appRoot, {
    files: ["plugin.info", 'styles/tiddlywiki.files'],
    annotation: "Metadata files",
});

js = uglify(js, {
    annotation: 'Uglify js files',
    uglify: {
        warnings: true,
        sourceMap: !process.env.PRODUCTION,
        output: { comments: 'some' }
    }
});

module.exports = new Merge([js,  info], { overwrite: true, annotation: "Final output" });

Thanks in advance

@danielo515
Copy link
Author

Ok, I isolated the problem by trying the different funnel trees in isolation with merge-trees. The latest version of funnel is working perfectly, just the desired files are copied, however babel-transpiler is copying the entire directory, no matter if they are js files, styles or whatever. Not sure how to proceed

@danielo515
Copy link
Author

I solved the problem by passing a funnel tree to the babel plugin instead of the approot. This way works, but feels wrong to create a funnel tree just to select the correct files for a plugin that already should be able to select the correct files.

This is what I did:

let js = new Funnel(appRoot, {
    include: ['**/*.js']
})

js = babel(js, {
    annotation: 'JS source code'
    , filterExtensions: ['js']
    , presets: [
        ['env', {
            'targets': {
                'browsers': ["last 2 versions"]
            }
        }]
    ]
});

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

No branches or pull requests

1 participant