为什么Parcel停止包含React代码?

时间:2019-03-01 01:07:11

标签: javascript reactjs typescript parceljs

我正在按照https://medium.freecodecamp.org/how-to-set-up-a-typescript-project-67b427114884中的说明进行操作。一切正常,直到我将app.tsx移到子目录(并注意index.html会反映该移动)。

移动app.tsx后,parcel index.html --log-level 4的输出为:

[5:00:07 PM]: Server running at http://localhost:1234 
[5:00:07 PM]: Building...
[5:00:07 PM]: Building index.html...
[5:00:07 PM]: Building app.tsx...
[5:00:07 PM]: Built src/app/app.tsx...
[5:00:07 PM]: Built index.html...
[5:00:07 PM]: Producing bundles...
[5:00:07 PM]: Packaging...
[5:00:07 PM]: Building hmr-runtime.js...
[5:00:07 PM]: Built ../.npm-packages/lib/node_modules/parcel-bundler/src/builtins/hmr-runtime.js...
[5:00:07 PM]: ✨  Built in 451ms.

在采取行动之前,会有更多的输出,其中一些提到了React:

[4:58:18 PM]: Server running at http://localhost:1234 
[4:58:18 PM]: Building...
[4:58:18 PM]: Building index.html...
[4:58:18 PM]: Building app.tsx...
[4:58:18 PM]: Building index.js...
[4:58:18 PM]: Building index.js...
[4:58:18 PM]: Building react.development.js...
[4:58:18 PM]: Building react-dom.development.js...
[4:58:19 PM]: Building index.js...
[4:58:19 PM]: Building checkPropTypes.js...
[4:58:19 PM]: Building index.js...
[4:58:19 PM]: Building tracing.js...
[4:58:19 PM]: Building ReactPropTypesSecret.js...
[4:58:19 PM]: Built node_modules/object-assign/index.js...
[4:58:19 PM]: Building scheduler.development.js...
[4:58:19 PM]: Building scheduler-tracing.development.js...
[4:58:19 PM]: Built node_modules/prop-types/lib/ReactPropTypesSecret.js...
[4:58:19 PM]: Built node_modules/prop-types/checkPropTypes.js...
[4:58:19 PM]: Built node_modules/react/cjs/react.development.js...
[4:58:19 PM]: Built node_modules/react/index.js...
[4:58:19 PM]: Built node_modules/scheduler/cjs/scheduler.development.js...
[4:58:19 PM]: Built node_modules/scheduler/index.js...
[4:58:19 PM]: Built node_modules/scheduler/cjs/scheduler-tracing.development.js...
[4:58:19 PM]: Built node_modules/scheduler/tracing.js...
[4:58:19 PM]: Built node_modules/react-dom/cjs/react-dom.development.js...
[4:58:19 PM]: Built node_modules/react-dom/index.js...
[4:58:19 PM]: Built app.tsx...
[4:58:19 PM]: Built index.html...
[4:58:19 PM]: Producing bundles...
[4:58:19 PM]: Packaging...
[4:58:19 PM]: Building hmr-runtime.js...
[4:58:19 PM]: Built ../.npm-packages/lib/node_modules/parcel-bundler/src/builtins/hmr-runtime.js...
[4:58:19 PM]: ✨  Built in 1.19s.

为什么Parcel不再包含React代码?需要做什么以使其继续包含其中?

0 个答案:

没有答案