我想在使用Webpack 2构建的项目中使用dat.GUI库。 如果我通过npm -install --save-dev dat.gui
安装模块,然后尝试使用import * as DAT from 'dat.gui';
导入它时,在Webpack尝试编译我的项目时会出现以下错误:
ERROR in ./~/dat.gui/src/dat/controllers/NumberControllerSlider.js
Module not found: Error: Can't resolve 'style' in
'/home/me/myProject/node_modules/dat.gui/src/dat/controllers'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix
when using loaders.
我知道在使用Webpack 2构建基于Webpack 1的项目时会出现此错误。但是,如果
node_modules/dat.gui/build
中已经有一个构建版本,为什么Webpack还要尝试构建模块呢?是否有办法告诉Webpack或NPM使用现有的构建版本而不尝试重新构建它?