有一个简单的回报,包括一个div。似乎babel-loader感到不高兴,看不出原因。我并不热衷于此,而只是尝试重建一个较旧的项目。 npm run build:all最终都对我试图退回div的回报感到沮丧。
如果我将div取出并做
调试:
Hash: 3fa4f48a100a48c899c6
Version: webpack 4.41.1
Time: 228ms
Built at: 10/13/2019 1:37:03 PM
1 asset
Entrypoint main = window_size.min.js
[1] ./src/lib/index.js 165 bytes {0} [built]
+ 1 hidden module
ERROR in ./src/lib/components/window_size.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (61:16)
59 |
60 | return (
> 61 | <div id={id}>
| ^
62 | Width: {width} Height: {height}
63 | </div>
64 | );
@ ./src/lib/index.js 2:0-79 4:0-34
版本:
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.5",
"copyfiles": "^2.0.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",