【发布时间】:2017-05-26 07:14:03
【问题描述】:
对于我们的项目,我们将 Angular2 与 webpack 和 yarn 一起使用。当我们尝试使用webpack --config webpack/webpack.dev.js 运行应用程序时,我们收到一条错误消息:
ERROR in ./src/main/webapp/app/app.main.ts
Module build failed: Error
at new FatalError (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint\lib\error.js:33:23)
at Function.findConfiguration (D:\workspace\deploy\webpackTest\marketplace\n
ode_modules\tslint\lib\configuration.js:97:15)
at resolveOptions (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint-loader\index.js:26:64)
at Object.module.exports (D:\workspace\deploy\webpackTest\marketplace\node_m
odules\tslint-loader\index.js:110:17)
ERROR in ./src/main/webapp/app/vendor.ts
Module build failed: Error
at new FatalError (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint\lib\error.js:33:23)
at Function.findConfiguration (D:\workspace\deploy\webpackTest\marketplace\n
ode_modules\tslint\lib\configuration.js:97:15)
at resolveOptions (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint-loader\index.js:26:64)
at Object.module.exports (D:\workspace\deploy\webpackTest\marketplace\node_m
odules\tslint-loader\index.js:110:17)
ERROR in ./src/main/webapp/app/polyfills.ts
Module build failed: Error
at new FatalError (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint\lib\error.js:33:23)
at Function.findConfiguration (D:\workspace\deploy\webpackTest\marketplace\n
ode_modules\tslint\lib\configuration.js:97:15)
at resolveOptions (D:\workspace\deploy\webpackTest\marketplace\node_modules\
tslint-loader\index.js:26:64)
at Object.module.exports (D:\workspace\deploy\webpackTest\marketplace\node_m
odules\tslint-loader\index.js:110:17)
tslint.json 文件是:
{
"rules": {
"no-unused-expression": true,
"no-duplicate-variable": true,
"no-duplicate-key": true,
"no-unused-variable": true,
"curly": true,
"class-name": true,
"semicolon": [false],
"semicolon": ["always"],
"triple-equals": true
}
}
我尝试了不同版本的 tslint,但它不起作用。
【问题讨论】:
-
能否请您添加 webpack 和 tslint 文件?
-
请注意,GitHub 风格的代码降价(三重反引号)在这里不起作用。
标签: angular webpack tslint yarnpkg