Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

chore(deps): update dependency webpack to v5 - #1306

Closed
renovate[bot] wants to merge 2 commits into
mainfrom
renovate/webpack-5.x
Closed

renovate[bot] wants to merge 2 commits into
mainfrom
renovate/webpack-5.x

Conversation

@renovate

@renovate renovate Bot commented Jun 5, 2021

Copy link
Copy Markdown
Contributor

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
webpack 4.46.0 -> 5.73.0 age adoption passing confidence

Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox. ⚠ Warning: custom changes will be lost.

This PR has been generated by Mend Renovate. View repository job log here.

@renovate
renovate Bot requested a review from a team June 5, 2021 12:40
@renovate renovate Bot added the renovate label Jun 5, 2021
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 3 times, most recently from f2eb384 to 4de3597 Compare June 7, 2021 18:02
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 3 times, most recently from 58b118e to bdf9f9b Compare June 21, 2021 17:56
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 4 times, most recently from d1837f8 to 25aff2e Compare July 5, 2021 14:43
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 2 times, most recently from c5d2ecf to db27532 Compare July 8, 2021 20:00
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 3 times, most recently from 8f4f31a to 22f1605 Compare July 22, 2021 12:21
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 6 times, most recently from 6a5d86a to a5f1ec1 Compare August 2, 2021 12:49
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 4 times, most recently from 5c85ef3 to ccdd264 Compare August 11, 2021 10:59
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 3 times, most recently from 418b5a4 to 1f40f0d Compare August 25, 2021 04:26
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 5 times, most recently from e55b878 to 25cd68b Compare August 25, 2021 06:14
@scissorsneedfoodtoo

Copy link
Copy Markdown
Contributor

Needs Webpack v4 / #1306 to be merged before this can be updated.

@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch 2 times, most recently from 8e52206 to af86b05 Compare August 26, 2021 05:35
@scissorsneedfoodtoo

scissorsneedfoodtoo commented Aug 26, 2021

Copy link
Copy Markdown
Contributor

This will need more investigation. To get this working, we'll need to:

  • add fallbacks to the Webpack config:
resolve: {
  fallback: {
    path: require.resolve('path-browserify'),
    util: require.resolve('util/')
  }
}
  • figure out why the test runner is erroring out in projects (process is not defined)

Edit: Turns out Webpack <= 4 included some useful polyfills, which were removed in v5. We just have to replace a few to prevent errors in the browser.

@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch from dd78ffe to 5e1a51c Compare September 30, 2021 08:28

@scissorsneedfoodtoo scissorsneedfoodtoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and everything seems to be working. Tests pass and the bundle size is about the same as it was with Webpack 4.

Will wait for another review before we merge this.

@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch from acb350d to 33c1211 Compare October 19, 2021 02:40
@scissorsneedfoodtoo

scissorsneedfoodtoo commented Oct 19, 2021

Copy link
Copy Markdown
Contributor

Just in case I trigger a rebase and force push from Renovate again, here are the updates we need to get Webpack v5 working:

  • Add additional packages to replace Node polyfills, which were removed in v5:
yarn add path-browserify buffer util process --dev
  • Update webpack.config.js to the following:
const path = require('path');
const webpack = require('webpack');

module.exports = function (env = {}) {
  const __DEV__ = env.production ? false : true;
  const outputPath = path.join(__dirname, 'build/testable-projects-fcc/v1');
  return {
    mode: __DEV__ ? 'development' : 'production',
    entry: './src/index.js',
    output: {
      library: 'FCC_Global',
      path: outputPath,
      filename: 'bundle.js'
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          // uses config from .babelrc
          loader: 'babel-loader'
        },
        {
          test: /\.css$/,
          exclude: /node_modules/,
          // creates String for importing into JS
          loader: 'css-loader'
        },
        {
          test: /\.html$/,
          exclude: /node_modules/,
          // creates String for importing into JS
          loader: 'html-loader'
        }
      ]
    },
    plugins: [
      new webpack.ProvidePlugin({
        Buffer: ['buffer', 'Buffer']
      }),
      new webpack.ProvidePlugin({
        process: 'process/browser'
      })
    ],
    resolve: {
      fallback: {
        path: require.resolve('path-browserify'),
        util: require.resolve('util/')
      }
    }
  };
};

Not much has changed in webpack.config.js. We just need to require Webpack and add some plugins and fallbacks to re-enable polyfills for some of the core Node modules.

@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch from f38a253 to 9fb0481 Compare October 26, 2021 03:55
@renovate
renovate Bot force-pushed the renovate/webpack-5.x branch from 4812ccc to e63ea49 Compare November 5, 2021 13:23
@renovate

renovate Bot commented Jul 12, 2022

Copy link
Copy Markdown
Contributor Author

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 5.x releases. But if you manually upgrade to 5.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate
renovate Bot deleted the renovate/webpack-5.x branch July 12, 2022 12:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants