question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

target structure is not correct when passing `file` as param to task

See original GitHub issue

i hope i am not doing something wrong,

this issue #200 was fixed and works perfectly now, but when using fly-babel if you dont pass file as param to the task function babel will transpile all files in path.

As i understood from the doc watch file should be passed, and it works great now babel only transpile the passed file, but the same problem in the referenced issue above occurs again.

here is my code

const paths = {
    scripts: ['./src/**/*.js']
}

export default async function () {
    await this.watch(paths.scripts, `babel`);
}

export async function babel(file) {
    await  this.source(file || paths.scripts)
        .babel({
            presets: [["es2015", {"modules": false}], "stage-1", "stage-3"],
            plugins: ["transform-es2015-modules-commonjs",
                ['transform-runtime', {
                    "polyfill": false,
                    "regenerator": true
                }]
            ],
            sourceMaps: true
        })
        .target(`./dist`);
 }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Oct 5, 2016

Nope, looks fine. I’ll hijack a machine.

1reaction
devmondocommented, Oct 2, 2016

@lukeed it works like charm and now browser-sync and compiling happen in 200 ms instead of 1.2 seconds!

i will continue testing to see if there are other edge cases.

thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HOW TO: Pass target object name to mapping task ... - Search
1. Provide session variable instead of object name (example: $a) in the mapping.
Read more >
How to pass command line arguments to a rake task
Looking at the code in rake.rb, it appears that rake does not parse task strings to extract arguments for prerequisites, so you can't...
Read more >
"Code 0x80070057 The parameter is incorrect" error when ...
Describes an issue that occurs when you try to display a user's "effective access" to a file or a folder on a file...
Read more >
Writing tasks - Puppet
By default, Bolt passes task parameters as both environment variables and as a single JSON object on stdin . The JSON input allows...
Read more >
Writing a Simple Buildfile - Apache Ant
No ; however, since Ant 1.6.0, every project includes an implicit target that contains any and all top-level tasks and/or ... Tasks have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found