9

Project requirements, The main.js file is not in the src root directory, and then run vue-cli-service serve has the following error

    * ./src/main.js in multi (webpack)-dev-server/client?http://10.0.68.112:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

File Directory src->server->main.js

vue.config.js

    const SkeletonWebpackPlugin = require('vue-skeleton-webpack-plugin')
    const path = require('path')

    module.exports = {
      outputDir: process.env.CLIENT_NAME === 'client' ? 'dist/client' : 'dist/server',
      configureWebpack: config => {
        if (process.env.CLIENT_NAME === 'client') {
          return {
            entry: {
              client: './src/client/main.js'
            },
            plugins: [
              new SkeletonWebpackPlugin({
                webpackConfig: {
                  entry: {
                    client: path.join(__dirname, './src/client/entry-skeleton.js')
                  },
                  output: {
                    libraryTarget: 'commonjs2'
                  }
                }
              })
            ]
          }
        } else {
          return {
            entry: {
              server: './src/server/main.js'
            }
          }
        }
      }
    }

1 Answer 1

-1

npm install --save-dev babel-loader try this

Sign up to request clarification or add additional context in comments.

1 Comment

Please give your answer with explanation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.