T
T
tuxx2017-08-31 15:24:44
JavaScript
tuxx, 2017-08-31 15:24:44

vue-cli webpack-simple build issue?

Installed vue-cli globally. I created a project with the webpack-simple template, but it swears when building:
Module not found: Error: Can't resolve 'fs'
Google offers a solution in the form of adding a line to webpack.config.js:

node: {
  fs: 'empty'
},

After that, the error appears
TypeError: exists is not a function
Function exists is existsSync from module fs. For this error, Google suggests adding the following line to webpack.config.js : After that, the browser swears that it doesn’t know what require is in js code
target: 'node'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tuxx, 2017-08-31
@tuxx

A complete rebuild of the project solved the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question