当我尝试编译ASP.NET项目时,我遇到了2个错误。我将React与ASP集成安装所需的模块,这是我的package.json:
{
"name": "lpmu-react-app",
"version": "1.0.0",
"description": "Integración de ReactJS con ASP.NET",
"main": "App.js",
"scripts": {
"start": "react-scripts start",
"webpack": "webpack --mode development",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "DPS",
"license": "ISC",
"dependencies": {
"react": "^16.4.0",
"react-dom": "^16.4.0",
"style-loader": "^0.21.0"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"webpack": "^4.12.0",
"webpack-cli": "^3.0.4"
}
}
我的webpack.config.js:
module.exports = {
context: __dirname,
entry: "./App.js",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
watch: true,
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-env', 'babel-preset-react'],
plugins: ['transform-class-properties']
}
}
},
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
}
}
当我执行npm run webpack
时,一切似乎按预期工作,我生成了我的bundle.js,但我不知道为什么会出现TS1800: No inputs were found in config file...
和{{1}的2个错误}。有些东西会影响ts文件,因为我并没有真正使用它们,我正在用JSX编写反应组件,所以我不知道为什么会出现这些错误。
由于