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.

Add an option to create symlink for all non-JavaScript files

See original GitHub issue

The original issue: http://stackoverflow.com/questions/32634521/is-there-a-variable-that-refers-to-the-package-base-directory?noredirect=1#comment53117653_32634521

Using gulp-babel to transpile code directories leaves out dependencies that are not JavaScript (e.g. JSON). All relative references to these dependencies will fail. Two possible solutions:

  • Create a symlink
  • Append a string to every require that resolves path to ./src/

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
gajuscommented, Oct 1, 2015

You do not need gulp-babel or gulp-copy for copying files. Just copy all the files from ./src to ./dist using gulp itself. Then overwrite the build files using gulp-babel.

gulp.task('copy', () => {
    return gulp
        .src('./src/**/*')
        .pipe(gulp.dest('./dist'));
});

gulp.task('build-es5', ['copy'], () => {
    return gulp
        .src('./src/**/*.js')
        .pipe(sourcemaps.init())
        .pipe(babel())
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest('./dist'));
});
0reactions
benderTheCrimecommented, Oct 1, 2015

@sindresorhus that makes sense and now that you put it that way (in the context of gulp), I understand. Thanks!

Sent from my iPhone

On Oct 1, 2015, at 11:36 AM, Sindre Sorhus notifications@github.com wrote:

@benderTheCrime That’s not how it’s done with Gulp. Idionmatic Gulp prefers separate plugins doing one thing, instead of every plugins doing everything. You already got a good answer. Another option is to source all the files, and use gulp-if to only run Babel on the JS files. gulp-filter would work too if you have many plugins that should run on only JS files.

— Reply to this email directly or view it on GitHub.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create symbolic links to all files (class of files) in a ...
In the 2nd form, create a link to TARGET in the current directory. ... cp with -s option can create a soft links...
Read more >
How to Create Linux Symlinks (Symbolic Links) - Hostinger
Create Symbolic Link in Linux for Files ... Generally, to create links use we use the ln command and the -s option to...
Read more >
How to Create Symbolic Links: A Comprehensive Guide
Need to get files and directories faster in Linux? Make administering your servers easier with this guide on how to create a symbolic...
Read more >
Symlink Tutorial in Linux – How to Create and Remove a ...
This will list all broken symlinks in the james directory – from files to directories to sub-directories. Passing the -delete option will delete ......
Read more >
How to Create Symbolic Link in Linux Using Ln Command
The -f option will force the command to overwrite a file that already exists. Source is the file or directory being linked to....
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