由于package.json中的模块键,源代码依赖性在Create React App中缩小

时间:2018-03-02 09:45:46

标签: javascript reactjs

如果创建了一个空白的Create React App并且MidiConvert库是一个依赖项,则可以进行开发。一旦构建开始,它会给出以下错误,指示它尝试缩小源文件:

$ react-scripts build
Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/midiconvert/src/Util.js:20

Read more here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

在MidiConvert的package.json中,以下条目触发源文件的构建。

"module": "src/MidiConvert.js",

删除后,React项目将构建。

相关链接:

0 个答案:

没有答案