Skip to content

output directory does not exist causes failure #5

@beagins

Description

@beagins

Given a sample file directory

my-app
|-- src
|    +-- (source files)
+-- test
|    +-- (test files)
+-- webpack
|    +-- development.config.js
+-- .package.json

when development.config.js has the following code snippet:

new archivePlugin({
    output: `${paths.build}/my-app`
  })

and ${paths.build} is defined: build: path.join(__dirname, '../', '/build'),

then I get an error: Error: ENOENT: no such file or directory, ... /my-app/build/my-app.zip


When I change the development.config.js code snippet to the following:

new archivePlugin({
    output: `${paths.dist}/my-app`
  })

then it does not encounter an error because the my-app/dist directory is created on run $webpack --config ./webpack/development.config.js as defined by the following code snippet:

output: {
    path: `${paths.dist}/`,
    filename: 'js/[name].js',
  }

however, the my-app.zip file is saved to my-app/dist instead of my-app/build.


I expect my-app/build directory to be created if it's not there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions