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

webpack-stream working with non-existent file #170

Open
ghost opened this issue Nov 16, 2017 · 0 comments
Open

webpack-stream working with non-existent file #170

ghost opened this issue Nov 16, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 16, 2017

Curently, I use webpack 3.4.1 and webpack-stream 4.0.0 within next imports:

const   gulp = require('gulp'),
        gulpIf = require('gulp-if'),
        webpackStream = require('webpack-stream'),
        webpack = webpackStream.webpack,
        named = require('vinyl-named');

I need to define the conditional output, then created the function inside gulp.dest(). Thanks to vynil-named, we don't need to define the entry points, however to define the output condition, we need to know where file gotten from (it may be public or admin paths, for example).

Inside 'gulp.dest()', it says that file gotten from C:\MyIde\projects\testProj\someEntryPoint.js, however actually this file is in C:\MyIde\projects\testProj\source\public\js\someEntryPoint.js:

gulp.task('webpack', function(){
   
   	/*	Entry points locations:
   		C:\MyIde\projects\testProj\source\public\js
   		C:\MyIde\projects\testProj\source\admin\js	*/

    return gulp.src('source')
        .pipe(named())
        .pipe(webpackStream())
        .pipe(gulp.dest( file => {
        	
            console.log('path: '+ file.path);
            // Output to console: "path: C:\MyIde\projects\testProj\someEntryPoint.js"
            // Real file path: 	C:\MyIde\projects\testProj\source\public\js\someEntryPoint.js

Before I ask "How to define desired output paths?", I need to understand what's going on. I defined the output paths for pug and sass by same way: nothing like this happened.

@ghost ghost changed the title WebpackStream working with unexisting file webpack-stream working with non-existent file Nov 16, 2017
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

0 participants