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

URL and output path need to be different #238

Open
s1n opened this issue May 31, 2017 · 0 comments
Open

URL and output path need to be different #238

s1n opened this issue May 31, 2017 · 0 comments

Comments

@s1n
Copy link

s1n commented May 31, 2017

So I have been learning gulp and working to deploy to a Github Page, so I setup the build reference like this:

<!-- build:js /project/scripts/combined.js-->
<link rel="text/javascript" href="/app/scripts/script.js">
<!-- endbuild-->

I'll trigger this with a gulp task that might look like this:

gulp.task('private:app:useref', () => {
      return gulp.src('./dist/**/*.html')
        .pipe(plugins.plumber())
        .pipe(plugins.useref())
        .pipe(gulp.dest('./dist/'));
    })

This will write the combined.js to the ./dist/project/scripts/ folder. However, the dist folder typically represents the document root of the github page, so I don't have a dist/project folder, I just have dist/scripts/. In order to deploy the dist folder to the gh-pages branch, I have to move the files in ./dist/project/ up to just dist. This feels clunky.

Is there a way to tell gulp-useref to write the combined file to one path with the URL it replaces being something else? In this case, I want to write combined.js to dist/scripts/combined.js and link to it in the HTML as /project/scripts/combined.js. Finding the files isn't the problem; I want the output file and the URL referenced in the gulp.src files to be be different.

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