我似乎不知道如何让摩卡-webpack在我的文件夹中检测测试。我正在运行以下命令:
mocha-webpack --webpack-config test/server/webpack.config-test.jswebpack.config-test.js
var nodeExternals = require("webpack-node-externals")
const path = require("path")
function resolve(dir)
{
return path.join(__dirname, "..", dir)
}
module.exports = {
context: path.resolve(__dirname),
resolve: {
extensions: [".js"],
alias: {
"vue$": "vue/dist/vue.esm.js",
"@": resolve("src"),
}
},
target: "node", // webpack should compile node compatible code
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
}如果有帮助的话,我也在用vue-cli,所以已经有webpack的吐露了,也许我可以引进其中的一个,然后做一些小小的改动。
发布于 2018-07-24 02:42:41
您需要将其添加到代码行中:
mocha-webpack --webpack-config test/server/webpack.config-test.js \"src/**/*.js\"
https://stackoverflow.com/questions/51434950
复制相似问题