Angular2使用webpack yarn

时间:2017-01-11 13:10:02

标签: angular webpack tslint yarnpkg

对于我们的项目,我们使用Angular2与webpack和纱线。当我们尝试使用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,但它无效。

1 个答案:

答案 0 :(得分:0)

尝试运行-std=gnu++14