Skip to content

"Setup" is deprecated warning #1121

Closed
Closed

Description

@jarodtaylor

Please note that this template is not optional. If you proceed with this form,
please fill out all fields, or your issue may be closed as "invalid."
Please do not delete this template. Please ask questions on StackOverflow or the
webpack Gitter (https://gitter.im/webpack/webpack). General questions, how-to
questions, and support requests will be closed.

Please do remove this header to acknowledge this message.

  • Operating System: Mac OS 10.11.6
  • Node Version: 8.2.1
  • NPM Version: 5.3.0
  • webpack Version: 3.6.0
  • webpack-dev-server Version: 2.9.0
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

  // webpack.config.js
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

/* create array of vendor libs to use in split from bundle */
const VENDOR_LIBS = [
  'react',
  'react-dom'
]

module.exports = {
  entry: {
    bundle: './src/app.js', /* bundle.js will contain everything from app.js */
    vendor: VENDOR_LIBS /* vendor.js will contain all VENDOR_LIBS */
  },
  output: {
    path: path.resolve(__dirname, 'dist'), /* output all files to /dist directory */
    filename: '[name].[chunkhash].js' /* add a hash to each filename for caching and cache busting */
  },
  devServer: {
    contentBase: path.join(__dirname, 'dist')
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'babel-loader'
      }
    ]
  },
  plugins: [
    /*
      Create an index.html file from the src/index.html file
      and add our <script> and <link> tags to it
    */
    new HtmlWebpackPlugin({
      template: './src/index.html'
    }),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor'
    })
  ]
};

When running webpack-dev-server --open I get the following:

Using "setup" is deprecated and will be removed in the next major version. Please use the "before" and "after" hooks instead. 
If "setup" was working fine for you until now, simply replace it with "before".

This is a very barebones React/Webpack boilerplate: https://github.com/jarodtaylor/react-boilerplates/tree/master/barebones

Activity

  1. shellscape commented on Sep 27, 2017

    @shellscape
    Contributor

    Duplicate of #1118. Upgrade to 2.9.1 😉

  2. jarodtaylor commented on Sep 27, 2017

    @jarodtaylor
    Author

    @shellscape interesting, I got 2.9.0 from running a fresh npm install --save-dev webpack-dev-server. Thanks for the response, I'm good to go, now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions