Can't use openlayers-3 with webpack

末鹿安然 提交于 2019-12-11 01:55:47

问题


I have to include openlayers in a project that I am working on. I have tried both including it in a ext folder and by npm.

I am using Webpack in my workflow. On compilation I get the following warning in my console.

WARNING in ./~/openlayers/dist/ol.js Critical dependencies: 730:1111-1118 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results. @ ./~/openlayers/dist/ol.js 730:1111-1118

Any idea what is this?


回答1:


It's telling you that the file you are trying to require is already built and suggesting you that use the main file instead of pre-built. Try to require main file instead of pre-built from dist folder and that should resolve your problem



来源:https://stackoverflow.com/questions/39078429/cant-use-openlayers-3-with-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!