所以我正在查看我的package.json文件-看起来没有什么特别疯狂的:
WITH
T (N) AS --TEST DATA
(SELECT '50,100,25,5000,1000' FROM DUAL
UNION
SELECT '25464,89453,15686' FROM DUAL
UNION
SELECT '21561,68547,51612' FROM DUAL
),
nums (x) as -- arbitrary limit of 20, can be changed
(select level from dual connect by level <= 20),
splitstr (N, x, substring) as
(select N, x, regexp_substr(N, '(.*?)(,|$)', 1, x, NULL, 1)
from T
inner join nums on x <= 1 + regexp_count(N, ',')
order by N, x)
select N, listagg(substring, ',') within group (order by to_number(substring)) as sorted_N
from splitstr
group by N
;
我尝试过npm install,npm install --production和npm install --express
无论我写什么npm命令,我都会得到以下信息:
{
"name": "application_name",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap-toggle": "^2.2.2",
"classnames": "^2.2.6",
"html-react-parser": "^0.4.6",
"jquery": "^3.3.1",
"react": "^16.4.1",
"react-bootstrap-toggle": "^2.3.1",
"react-cookie": "^3.0.4",
"react-dom": "^16.5.2",
"react-load-script": "0.0.6",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"react-timer-mixin": "^0.13.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && robocopy .\\build ..\\www /MIR",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
最终是202M-这是不对的,那是巨大的模块数量
这是我正在从事的一个React项目。
我之所以只提出这个问题,是因为其他答案似乎都不适合我的情况。
是否有解决此问题的方法?我打算将其编译为移动应用程序,而202M对于一个非常简单的应用程序来说是一个巨大的足迹。
答案 0 :(得分:1)
202Mb几乎完全被开发依赖项react-scripts
占据。
react-scripts
是一个捆绑包,其中包含Webpack和运行项目所需的其他工具。它由Create React App提供,它只是一个可执行文件,可使用react-scripts
创建样板项目:
此软件包包括Create React使用的脚本和配置 应用程序。
node_modules
的大小足以满足CRA设置的复杂配置要求。它不会影响已编译应用程序的大小。