When attempting to run the command "cross-env NODE_ENV=development nodemon ./server.js", I encountered the following error:
ModuleBuildError: Module build failed (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
SyntaxError: Unexpected token (13:968)
How can I resolve this issue? My setup includes Vue 2, Webpack 4, and Vue-loader 15.
I have configured my webpack.config and vue.config files as follows:
const { VueLoaderPlugin } = require("vue-loader");
module.exports = {
chainWebpack: config => {
config.plugins.delete("prefetch");
},
configureWebpack: {
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.js$/,
loader: "babel-loader"
},
{
test: /\.css$/,
use: ["vue-style-loader", "css-loader"]
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx"],
alias: {
vue$: "vue/dist/vue.runtime.esm.js"
}
}
}
};