target structure is not correct when passing `file` as param to task
See original GitHub issuei 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:
- Created 7 years ago
- Comments:22 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nope, looks fine. I’ll hijack a machine.
@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.