Can't use openlayers-3 with webpack

2019-07-10 12:16发布

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条回答
Root(大扎)
2楼-- · 2019-07-10 12:39

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

查看更多
登录 后发表回答