WebPack编译错误与柏树 - 拖列库
我添加了 cypress-drag-drop library 在我的项目中,我与<<代码> Angular 。在本地,一切都可以正常工作,并且测试通过了。但是,当我在jenkins
中运行测试时,它将显示下一个错误:
我已经配置我不明白为什么它显示此错误。
在command.js
中,我添加了:
在package.json
中:
我的tsconfig。 json
:
我试图在我的webpack.config.prod.js中添加一个别名,但它仍然失败。
module.exports = env => ({
entry: path.resolve(__dirname, "src/root-config"),
output: {
filename: "root-config.js",
libraryTarget: "system",
path: path.resolve(__dirname, "dist")
},
devtool: "sourcemap",
module: {
rules: [
{ parser: { system: false } },
{
test: /\.js$/,
exclude: /node_modules/,
use: [{ loader: "babel-loader" }]
}
]
},
resolve: {
alias: {
"@4tw": path.resolve(__dirname, "src")
}
},
plugins: [
new CopyWebpackPlugin([
{ from: path.resolve(__dirname, "src/favicon.ico"), to: "favicon.ico" },
{ from: path.resolve(__dirname, "img"), to: "img" },
{
from: path.resolve(__dirname, "src/importmap.json"),
to: "importmap.json"
},
{
from: path.resolve(__dirname, "node_modules/primeicons"),
to: "primeicons"
}
]),
new HtmlWebpackPlugin({
inject: false,
template: "src/index.ejs",
templateParameters: {
isLocal: env && env.isLocal
}
}),
new CleanWebpackPlugin()
],
externals: ["single-spa", /^@monitor\/.+$/, "i18next"]
});
有人有这个错误吗?
I have added the cypress-drag-drop library in my project where I worked with Angular
. In local, everything works fine and the tests passed. However, when I run the tests in Jenkins
, it is displaying the next error:
I have configured how the readme.md
said, so I don't understand why it is displaying this error.
In command.js
, I have added:
In package.json
:
My tsconfig.json
:
I have tried to add an alias in my webpack.config.prod.js, but it is still failing.
module.exports = env => ({
entry: path.resolve(__dirname, "src/root-config"),
output: {
filename: "root-config.js",
libraryTarget: "system",
path: path.resolve(__dirname, "dist")
},
devtool: "sourcemap",
module: {
rules: [
{ parser: { system: false } },
{
test: /\.js$/,
exclude: /node_modules/,
use: [{ loader: "babel-loader" }]
}
]
},
resolve: {
alias: {
"@4tw": path.resolve(__dirname, "src")
}
},
plugins: [
new CopyWebpackPlugin([
{ from: path.resolve(__dirname, "src/favicon.ico"), to: "favicon.ico" },
{ from: path.resolve(__dirname, "img"), to: "img" },
{
from: path.resolve(__dirname, "src/importmap.json"),
to: "importmap.json"
},
{
from: path.resolve(__dirname, "node_modules/primeicons"),
to: "primeicons"
}
]),
new HtmlWebpackPlugin({
inject: false,
template: "src/index.ejs",
templateParameters: {
isLocal: env && env.isLocal
}
}),
new CleanWebpackPlugin()
],
externals: ["single-spa", /^@monitor\/.+$/, "i18next"]
});
Does anybody has this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论