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

Use Webpack 2 #34

Closed
wants to merge 6 commits into from
Closed

Use Webpack 2 #34

wants to merge 6 commits into from

Conversation

wendorf
Copy link
Contributor

@wendorf wendorf commented Apr 30, 2017

This builds on #33 and updates to Webpack 2 (technically, this PR brings in Webpack as an explicit dependency at all).

Webpack 2 introduces some breaking changes and requires some bumps to other packages, so that's taken care of in this as well. I tested that things were working by running all the gulp tasks in pivotal-cf/react-starter using this branch of pui-react-tools.

To test this on your own, you will need to:

  • update react-starter's dependencies: babel-loader to ^7 and extract-text-webpack-plugin to ^2.
  • require('babel-loader instead of require('babel in app/index.js

wendorf added 6 commits April 30, 2017 15:21
Deprecated as of React v15.5
This stays away from Webpack dependencies, which are more-easily bumped
after Webpack itself is bumped.

- vinyl to ^2
- url-join to ^2
- multipipe to ^1
- loader-utils to ^1
- gulp-sourcemaps to ^2
- gulp-sass to ^3
  - libsass from 3.3.2 to 3.4.3
- gulp-progeny to ^0.4
  - progeny from 0.7 to 0.11
- gulp-filter to ^5
- foreman to ^2
- babel-eslint to ^7
  - Drops support for Node < 4
- npm to ^4
Remove unused packages

- gulp-env
- gulp-livereload
- gulp-tap
- gulp-wait
- lodash.debounce
- lsof
- portfinder
- react-addons-test-utils
- babel-preset-es2015-loose
  - This is deprecated. As of Babel v6.13+, babel-preset-es2015 has a built-in
    loose option.
extract-text-webpack-plugin must also be bumped to ^2

webpack-stream uses Webpack 1, so we must pass it Webpack 2

Both bumps introduce some deprecations that are cleaned up here:
- Webpack refuses a config with extra properties, including
"browserAppAssetsOptions". A `delete` isn't the best, but works. I'd
rather someone with more familiarity with the codebase perform the
correct refactor.
- Webpack loader definition has changed, including using  "rules" and
requiring the "-loader" suffix
- extract-text-webpack-plugin syntax is slightly changed
- `externals` and `quiet` are no longer accepted Webpack config keys
- noErrors is deprecated in favor of noEmitErrors
- UglifyJsPlugin defaults are changed to match the previous explicit
config
- babel-loader to ^7
  - Drops support for Node < 4 and Webpack 1
- sass-loader to ^6
  - Drops support for node-sass 3 and webpack 1
  - Drops support for synchronous compilation
- file-loader to ^0.11
- css-loader to ^0.28
- style-loader to ^0.16
@charleshansen
Copy link
Contributor

Thanks Dan, I ended up finishing the bigger webpack 2 upgrade instead of taking the PR.

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

Successfully merging this pull request may close these issues.

2 participants