Coder Social home page Coder Social logo

Comments (2)

bcowgill avatar bcowgill commented on June 28, 2024

I have a fix. Just need to use different options to the Uglify when debugging. Must still compress, but don't mangle and beautify the output again.

// Optimize the bundle in release (production) mode
if (!DEBUG) {
  config.plugins.push(new webpack.optimize.DedupePlugin())
}

// Must always Uglify somehow or it won't work in IE8
const uglyOptions = !DEBUG ? {
  compress: {
    warnings: VERBOSE,
    typeofs: false, // suggested for IE10 or less
    screw_ie8: false
  },
  mangle: { screw_ie8: false },
  output: { screw_ie8: false }
} : {
  mangle: false,
  compress: {
    drop_debugger: false,
/* could set lots more settings false to leave the code as is. */
    typeofs: false, // suggested for IE10 or less
    warnings: VERBOSE,
    screw_ie8: false
  },
  output: {
    beautify: true,
    comments: true,
    bracketize: true,
    indent_level: 2,
    keep_quoted_props: true,
/* more settings to your liking... */
    screw_ie8: false
  },
};
config.plugins.push(new webpack.optimize.UglifyJsPlugin(uglyOptions))

if (!DEBUG) {
  config.plugins.push(new webpack.optimize.AggressiveMergingPlugin())
  config.module.loaders
    .find(x => x.loader === 'babel-loader').query.plugins
    .unshift(
    'transform-react-remove-prop-types',
    'transform-react-constant-elements',
    'transform-react-inline-elements',
    'transform-es3-modules-literals',
    'transform-es3-member-expression-literals',
    'transform-es3-property-literals'
    )
}

from react-static-boilerplate.

copilot-is avatar copilot-is commented on June 28, 2024

Thank you.
Fix 4c38aef

from react-static-boilerplate.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.