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

'gulp dev-release' js and css file paths replacement error #512

Open
4everYoungg opened this issue Nov 25, 2019 · 0 comments
Open

'gulp dev-release' js and css file paths replacement error #512

4everYoungg opened this issue Nov 25, 2019 · 0 comments

Comments

@4everYoungg
Copy link

when i run gulp task with dev-release in development environment as :

gulp dev-release,

only the css file paths are replaced ,the js file paths are not replaced, which bothers me a lot.
And finally, i solve it by merging 'dev-css-replace' and 'dev-js-replace' tasks into one gulp task 'dev-static-replace' like this:

gulp.task('dev-static-replace', ['dev-copy-assets'], function () {
    return gulp.src(path.join(conf.paths.devDist, '*.html'))
        .pipe($.replace(/<link rel="stylesheet" href="\.\.\/bower_components\/.*\/(.*)"\s*?\/>/g, '<link rel="stylesheet" href="lib/$1" >'))
        .pipe($.replace(/<script src="\.\.\/bower_components\/.*\/(.*)"\s*?>/g, '<script src="lib/$1">'))
        .pipe(gulp.dest(conf.paths.devDist));
});

and, change the 'dev-release' task into :

gulp.task('dev-release', ['dev-static-replace']);

and it works!both the js and css file paths are replaced with the prefix 'lib/'

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