G'day。我似乎无法简单地工作!
我有一个目录结构
student
现在在myapp的React客户端中,我想使用来自globalstuff的JSX代码,但尚未进行编译。在include上似乎应该是一个简单的正则表达式:但是对于我一生,我无法理解! 帮助表示赞赏!
要求示例!感谢您的光临!
编辑
myapp
app
server
api.py
client
dist
node_modules
package.json
src
webpack.config.js
smartForm
smartform.js
morestuff
morestuff.js
我想从多个客户端应用程序中使用smartForm。
我的webpack是这样的:已编辑。
ERROR in /disk/dev/www/smartForm/smartForm.js
Module build failed: SyntaxError: Unexpected token (244:16)
242 | }
243 |
> 244 | return( <div>
| ^
245 | {formOut}
246 | </div>
247 | );
@ ./src/containers/people_new_edit.js 23:17-62
@ ./src/routes.js
@ ./src/components/app.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8888 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8888 webpack/hot/only-dev-server ./src/index.js
webpack: Failed to compile.
我希望这更清楚!看起来很简单,但我不明白! 包含已被拉入,但是JSX没有被转译。 干杯。
我将REGEX更改为字符串。结果相同。 JSX没有被编译。我更改了目录描述以使其更加清晰。塔。
答案 0 :(得分:1)
使用path.resolve(__dirname, '../', '../', '../', 'smartForm')