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

please update webpack@2.x.x #125

Open
MeCKodo opened this issue Aug 29, 2016 · 10 comments

Comments

@MeCKodo
Copy link

@MeCKodo MeCKodo commented Aug 29, 2016

i want use tree-shaking!

@arobbins

This comment has been minimized.

Copy link

@arobbins arobbins commented Sep 10, 2016

Any idea when this will be updated? Would love this as-well.

@xtianus79

This comment has been minimized.

Copy link

@xtianus79 xtianus79 commented Sep 12, 2016

@MeCKodo @arobbins

I am looking into using the webpack angular2 starter pack. Have you guys looked into using those? If so, or whatever, what would be wrong with incorporating gulp or grunt into those starter kits? from what i see this is just using grunt or gulp to kick off those commands

@dcholth

This comment has been minimized.

Copy link

@dcholth dcholth commented Sep 13, 2016

One suggestion would be to switch to using gulp-shell and execute it directly. This turned out to be a very easy switch for us because we weren't really able to take advantage of the things with gulp we wanted because of issue #72 anyway.

@GuillaumeLeclerc

This comment has been minimized.

Copy link

@GuillaumeLeclerc GuillaumeLeclerc commented Nov 5, 2016

You can solve that by installing webpack 2 in your package and then doing:

gulp.src('FILES').pipe(webpack(config, require('webpack')))
@saponifi3d

This comment has been minimized.

Copy link

@saponifi3d saponifi3d commented Nov 8, 2016

This should probably also make webpack a peerDependency instead, so end users can control the version of webpack and pin this within a specific range.

@xtianus79

This comment has been minimized.

Copy link

@xtianus79 xtianus79 commented Nov 17, 2016

@GuillaumeLeclerc so with webpack 2 you can use / call grunt/gulp commands from within webpack? if so I am going to be so happy!!!

@GuillaumeLeclerc

This comment has been minimized.

Copy link

@GuillaumeLeclerc GuillaumeLeclerc commented Nov 21, 2016

@xtianus79 No it's the other way arround. Start webpack2 in gulp.

In my example I show you how to use webpack-stream with the version of webpack you want. In my example I require webpack and in my package.json I have the version 2.1.0.beta27. And webpack-stream uses it instead of the one he bundles (1.3 something if I remember well)

@zwacky

This comment has been minimized.

Copy link

@zwacky zwacky commented Feb 2, 2017

I'm also on board with @saponifi3d to use peerDependencies.

for a comparison, grunt's webpack uses this:

"peerDependencies": {
    "webpack": "^2.1.0-beta || ^2.2.0-rc || ^2.0.0"
}

edit: didn't see that it's not very maintained anymore.
I'm using @GuillaumeLeclerc 's approach, and it works 👍

@sebworks

This comment has been minimized.

Copy link

@sebworks sebworks commented Feb 7, 2017

The @GuillaumeLeclerc solution works well. We are using the following setup:

var handleErrors = require( '../utils/handle-errors' );
var webpack = require( 'webpack' );
var webpackConfig = require( '../../config/webpack-config.js' );
var webpackStream = require( 'webpack-stream' );

/**
 * Standardize webpack workflow for handling script
 * configuration, source, and destination settings.
 * @param {Object} config - Settings for webpack.
 * @param {string} src - Source URL in the unprocessed assets directory.
 * @param {string} dest - Destination URL in the processed assets directory.
 * @returns {PassThrough} A source stream.
 */
function _processScript( config, src, dest ) {
  return gulp.src( paths.unprocessed + src )
    .pipe( webpackStream( webpackConfig, webpack ) )
    .on( 'error', handleErrors )
    .pipe( gulp.dest( paths.processed + dest ) )
    .pipe( browserSync.reload( {
      stream: true
    } ) );
}
@zaguiini

This comment has been minimized.

Copy link

@zaguiini zaguiini commented Aug 21, 2017

I love you so much, @GuillaumeLeclerc. Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.