Skip to content

formatStats.js uses hard coded output path #809

Closed
@hellixir

Description

@hellixir

Version

3.0.0-alpha.9

Reproduction link

https://github.com/vladra/vue-cli-bug

Steps to reproduce

  1. Create brand new vue-cli 3 application
  2. Edit vue.config.js to have this contant:
module.exports = {
  configureWebpack: {
    output: {
      path: path.resolve(__dirname, './other_folder'),
    },
  },
};
  1. Run yarn build

What is expected?

Expected build to be successful

What is actually happening?

Command build files, but fails to finish successfully during the formatStats step.


It seems that file path in formatStats.js is hardcoded and doesn't use config from vue.config.js

Stacktrace:

fs.js:663
  return binding.open(pathModule.toNamespacedPath(path),
                 ^

Error: ENOENT: no such file or directory, open 'PATH/client/dist/js/vendor.13e9fbad.js'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.readFileSync (fs.js:568:33)
    at getGzippedSize (PATH/client/node_modules/@vue/cli-service/lib/commands/build/formatStats.js:43:23)
    at ui.div.assets.map.a (PATH/client/node_modules/@vue/cli-service/lib/commands/build/formatStats.js:62:7)
    at Array.map (<anonymous>)
    at formatStats (PATH/client/node_modules/@vue/cli-service/lib/commands/build/formatStats.js:57:12)
    at webpack (PATH/client/node_modules/@vue/cli-service/lib/commands/build/index.js:89:17)
    at emitRecords.err (PATH/client/node_modules/webpack/lib/Compiler.js:265:13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions