Home > front end >  What packages do I need to install to accomplish a "vue build <src path> --config <con
What packages do I need to install to accomplish a "vue build <src path> --config <con

Time:03-08

I've forked an old Vue.js package that has some issues in it (v-money) and made the necessary changes to accomplish what I need. But now when I try to build using the package's original method, I'm getting an error:

npm run build

vue build ./src/index.js --config ./build.config.js --dist ./dist/ --prod --lib "--disable-compress"

Usage: vue build [options]

alias of "npm run build" in the current project

Options:
  -h, --help  display help for command

  Unknown option --config.

I'm guessing I've got the wrong version of Vue.js installed, as the package didn't indicate what version it's supposed to be, but I can't find anything on the web that shows --config, --dist, --prod, and --lib as build options for Vue.js.

I've attempted to build the package as-is without any of my small changes and that fails in the same way.

CodePudding user response:

Install the following dev dependencies from the root of the v-money project:

npm i -D [email protected] \
         uglify-es \
         uglifyjs-webpack-plugin@^1

Edit build.config.js to use the Uglify dependencies installed above:

const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

module.exports = {
  webpack: {
    ⋮
    plugins: [
      new UglifyJSPlugin(),
      ⋮
    ]
  }
}

demo

  • Related