Webpack Packaging has been configured vue-loader package still reports an error You may need an appropriate loader. when packaged

webpack packaging has been configured with vue-loader, but still reported an error when packaging

webpack.config.js

const path = require("path");

module.exports = {
    entry: __dirname+"/app/index.js",
    output: {
        path: __dirname+"/build",
        filename: "bundle.js"
    },module: {
        rules: [
        {
            test: /\.vue$/,
            use: [
                { loader: "vue-loader" },
            ]
        }
        ]
    }
};

error report:

clipboard.png

package.json

{
  "name": "todolist",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack --config webpack.config.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "css-loader": "^0.28.11",
    "vue": "^2.5.16",
    "vue-loader": "^14.2.2",
    "vue-template-compiler": "^2.5.16",
    "webpack": "^4.5.0"
  },
  "dependencies": {},
  "description": ""
}
Mar.04,2021

new Vue({});rule,js

this is an error message that is not configured by the babel-loader parsing the JS file.

you have only one vue-loader configured.

Menu