Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

New Feature Request- 'jsFilePath' #46

Open
ermish opened this issue Jun 29, 2016 · 2 comments
Open

New Feature Request- 'jsFilePath' #46

ermish opened this issue Jun 29, 2016 · 2 comments

Comments

@ermish
Copy link

ermish commented Jun 29, 2016

Feature Request

A nice feature would be the ability to set the javascript file path.

Example

Currently, the path for a js file from /dist/views/index.html is index.js.
An option, such as jsFilePath : '/dist/js/' would change index.js to /dist/js/index.js.

My particular issue

I'm currently vulcanizing my components all the way to the top level html file. As a result, my view at /dist/views/index.html has a path of / and it looks for http://myhost.com/index.js which doesn't exist.

Thanks Team!

@ermish ermish changed the title Support setting js File Path. New option - 'jsFilePath' Jun 29, 2016
@ermish ermish changed the title New option - 'jsFilePath' New Feature Request- 'jsFilePath' Jun 29, 2016
@Steven-Roberts
Copy link

+1 for this feature, especially when dealing with multiple source files in gulp. By using gulp-foreach, this is my current fix to this:

return gulp.src(...) // Many source files
        .pipe(vulcanize(...))
        .pipe(gulpForeach((stream, file) => { 
            const jsFileName = getCorrectPath(file);
            return stream.pipe(crisper({
                jsFileName: jsFileName
            }));
        }))
        .pipe(gulp.dest(...));

It would be nice to eliminate this messy workaround.

@klebba
Copy link

klebba commented May 9, 2017

This is necessary for pushState -- the path must be /index.js, but it isn't configurable. I used this in my bash build script to fix it:

sed -i '' 's/src="index.js"/src="\/index.js"/g' index.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants