Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Issue in Webpack production build #259

Open
zoephilipps opened this issue Apr 10, 2020 · 0 comments
Open

Issue in Webpack production build #259

zoephilipps opened this issue Apr 10, 2020 · 0 comments

Comments

@zoephilipps
Copy link

In a Webpack production bundle, slideDown on VelocityComponent appears to work fine until the end of the animation, where it sets the height back to 0. There are no errors and I haven't the slightest clue as to what could be causing this. Everything works beautifully in dev mode.

Here's my Webpack config. Hopefully someone has some insight.

const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')

const env = process.env.NODE_ENV

module.exports = {
  mode: env || `production`,
  devtool: env === `production` ? `source-map` : `eval-source-map`,
  entry: {
    index: { import: `./Scripts/React/src/index.js`, dependOn: 'shared' },
    shared: [
      `core-js/es/promise`,
      `core-js/es/array/from`,
      `whatwg-fetch`,
      `velocity-animate`,
    ],
  },
  output: {
    filename: '[name].bundle.js',
    path: path.resolve(__dirname, 'Scripts/React/dist'),
  },
  // optimization: {
  //   minimizer: [
  //     new TerserPlugin({
  //       terserOptions: {
  //         output: {
  //           comments: false,
  //         },
  //       },
  //       sourceMap: true,
  //     }),
  //   ],
  // },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
            options: {
              presets: [
                [
                  '@babel/preset-env',
                  {
                    // debug: true,
                    corejs: 3.6,
                    useBuiltIns: 'usage',
                  },
                ],
                ['@babel/preset-react'],
              ],
              plugins: ['babel-plugin-styled-components'],
            },
          },
          {
            loader: 'eslint-loader',
          },
        ],
      },
      {
        test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
        use: [
          {
            loader: 'file-loader',
            options: {
              name: '[name].[ext]',
              outputPath: 'fonts',
              publicPath: '/App/Scripts/React/dist/fonts',
            },
          },
        ],
      },
    ],
  },
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant