我正在尝试将我当前的项目(在Angular2上)迁移到webpack2。这是我对webpack的配置:
https://gist.github.com/kunashir/5174a237d7404079ebd8f343deee0037
但是我得到了一个错误:
ERROR in ./app/common/forms/ckeditor.component.ts
Module not found: Error: Can't resolve 'exports' in
'/home/al1/projects/voltmobi/ytaxiweb/ui/app/common/forms'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'exports-loader' instead of 'exports',
see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed但是,我没有使用exports-loader,而且它也不在webpack1的配置中。
来自引入错误的模块的字符串:
import { Constants } from 'config/constants'用于导入的模块如下:
export class Constants {
static API = {
PATH: '/web_api'
}
}我是Webpack的新手。
也许我错了,问题出在:
let loadCKEDITOR = require('bundle-loader?lazy!exports?window.CKEDITOR!ckeditor/ckeditor')发布于 2017-08-01 17:43:46
您没有在配置中使用exports-loader,但您将其指定为inline
let loadCKEDITOR = require('bundle-loader?lazy!exports?window.CKEDITOR!ckeditor/ckeditor')
^^^^^^^如错误所示,这应该是exports-loader。
let loadCKEDITOR = require('bundle-loader?lazy!exports-loader?window.CKEDITOR!ckeditor/ckeditor')https://stackoverflow.com/questions/45432707
复制相似问题