Skip to content

"Setup" is deprecated warning #1121

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

Closed
1 of 3 tasks
jarodtaylor opened this issue Sep 27, 2017 · 2 comments
Closed
1 of 3 tasks

"Setup" is deprecated warning #1121

jarodtaylor opened this issue Sep 27, 2017 · 2 comments

Comments

@jarodtaylor
Copy link

jarodtaylor commented Sep 27, 2017

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

@shellscape
Copy link
Contributor

shellscape commented Sep 27, 2017

Duplicate of #1118. Upgrade to 2.9.1 😉

@jarodtaylor
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants