Issue with Vue Project
In our application, we encountered a problem where one of the indirect dependencies had JS files that were causing Webpack to fail during parsing. To resolve this issue, I integrated a babel-loader
.
const webpack = require("webpack");
module.exports = {
entry: './src/index.ts',
target: 'node',
mode: 'production',
module: {
rules: [
{
test: /\.(ts|tsx)$/,
loader: 'ts-loader',
},
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
}
]
},
plugins: [
new webpack.IgnorePlugin(/vertx/),
],
resolve: {
extensions: ['.js', '.ts']
},
output: {
filename: 'index.js',
path: `${__dirname}/dist`,
library: 'stormcv-website-client',
libraryTarget: 'umd'
}
}
.babelrc
{
"presets": ["react", "es2015", "stage-0"]
}
Package.json:
{
"name": "stormcv-website-client",
"version": "1.0.0",
"description": "client",
"homepage": "",
"license": "UNLICENSED",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"browserquot;: {
"vertx": false
},
"repository": {
"type": "git",
},
"dependencies": {
"coral-super-client": "*"
},
"scripts": {
"build": "webpack",
"clean": "rm -rf build dist node_modules package-lock.json",
"prepublishOnly": "npm run build"
},
"devDependenciesquot;: {
...
}
}
Despite attempts, the build process continues to fail due to various errors such as the following:
[00:02] info Rebuilding package-lock.json
...
BUILD FAILED
or
[00:03] info Rebuilding package-lock.json
...
BUILD FAILED
I have searched for similar issues on Stack Overflow and tried the following steps:
npm cache clean --force
rm -rf package-lock.json /node_modules
npm install
However, I am still unable to resolve these errors. It feels like I might be overlooking something fundamental. Any suggestions?