mzgoddard / jest-webpack

Use jest with webpack.
https://www.npmjs.com/package/jest-webpack
92 stars 21 forks source link

Support flags for webpack #14

Open mzgoddard opened 7 years ago

mzgoddard commented 7 years ago

Support flags to pass options to webpack. Since this tool is intended to sit in front of jest and integrate webpack in options should follow jest's format but be prefixed with webpack. Like a config option would be --webpackConfig.

Related: https://github.com/mzgoddard/jest-webpack/issues/3#issuecomment-309194153

mzgoddard commented 6 years ago

jest-webpack 0.4 lets you specify webpack options after jest options.

Usage: jest-webpack [jest options] [--[webpack] [webpack options]]
samvincent commented 6 years ago

Hi @mzgoddard,

This portion of code keeps exiting and listing webpack options

var webpackArgv = webpackYargs.parse(webpackArgvPortion);

I can see that it received --webpack --config webpack.config.js correctly based on the output, but the process exit is preventing me from running main().

Providing just the bottom of the webpack output:

Missing argument values: config-name, context, entry, module-bind, module-bind-post, module-bind-pre, output-path, output-filename, output-chunk-filename, output-source-map-filename, output-public-path, output-jsonp-function, output-library, output-library-target, records-input-path, records-output-path, records-path, define, target, watch-aggregate-timeout, devtool, resolve-alias, resolve-extensions, resolve-loader-alias, optimize-max-chunks, optimize-min-chunk-size, prefetch, provide, plugin

Using webpack@3.8.1

Any ideas? Greatly appreciate this project.

Morozzzko commented 6 years ago

This portion of code keeps exiting and listing webpack options

I've got the same problem here.

What I did was pass --webpack --config config/webpack.config.js to the script. But it keeps showing me webpack config options

fsworld009 commented 6 years ago

Same issue with --webpack --config

janhapke commented 6 years ago

I have the same issue and have created a pull-request that fixes it for me: #33