Giter Club home page Giter Club logo

Comments (6)

75lb avatar 75lb commented on July 26, 2024

what is this, how exactly do I reproduce it? Is this an issue with uglify or command-line-args?

from command-line-args.

zhenyulin avatar zhenyulin commented on July 26, 2024

@75lb thanks for the quick response.

Here's my webpack uglify plugin settings

new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      minimize: true,
      comments: false,
      compress: {
        dead_code: true,
        unused: true,
        warnings: false,
        screw_ie8: true,
      },
      exclude: [/\.min\.js$/gi],
    }),

here's the command-line-args code

const commandLineOptionSchema = [{ name: 'TEST', type: String }];

const commandLineOptions = commandLineArgs(commandLineOptionSchema);

console.log('command line test: ', commandLineOptions.TEST);

Not sure if this is an issue for command-line-args or uglify yet, but might be easier to start looking on this end?

from command-line-args.

75lb avatar 75lb commented on July 26, 2024

why would you use webpack on this library? Command-line-args is not for the web, it's for node.js command-line-tools only.

from command-line-args.

zhenyulin avatar zhenyulin commented on July 26, 2024

@75lb I'm trying to pass in run time environment variables with command-ling-args as client side code wouldn't take process.env after it is built.

from command-line-args.

75lb avatar 75lb commented on July 26, 2024

it's an issue with Uglify - the version you are using does not support ES6 code.. see here.

from command-line-args.

zhenyulin avatar zhenyulin commented on July 26, 2024

@75lb thanks for pointing this out, I've tried with https://github.com/webpack-contrib/uglifyjs-webpack-plugin, but still got the same error; the error message doesn't look like an ES6 feature here though

from command-line-args.

Related Issues (20)

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.