【发布时间】:2016-01-08 03:56:38
【问题描述】:
如何为 React-redux-es6-typescript-immutable 应用程序配置 wallaby。我使用 webstorm 编辑器。我的基本代码已提交here
我在 wallaby.js 中尝试了以下代码,但它抛出了
ReferenceError:找不到变量:导出
在 src/store.ts:3
module.exports = function (wallaby) {
return {
files: [
'src/*.ts'
],
tests: [
'test/*Spec.ts'
],
compilers: {
'**/*.ts': wallaby.compilers.typeScript({
module: 5, // ES6
target: 2 // ES6
})
},
preprocessors: {
'**/*.js': file => require('babel-core').transform(
file.content,
{sourceMap: true, presets: ['es2015']})
}
}
}
【问题讨论】:
-
看起来您的应用程序正在使用 CommonJs(和 Webpack),因此您需要配置 wallaby.js 以使用 webpack,如下所述wallabyjs.com/docs/integration/webpack.html
-
添加环境变量完成了工作。我的工作小袋鼠配置如下: module.exports = function (wallaby) { return { files: [ 'src/*.ts' ], tests: [ 'test/*Spec.ts' ], env: { type: '节点'},编译器:{'*/.ts': wallaby.compilers.typeScript({ module: 1 }) } } }
标签: wallaby.js