Webpack 迁移到网页2,未找到模块:错误:Can';t解决';出口';
我正在尝试将我当前的项目(在Angular2上)迁移到webpack2。 这是我的网页包配置: 但我有一个错误:Webpack 迁移到网页2,未找到模块:错误:Can';t解决';出口';,webpack,Webpack,我正在尝试将我当前的项目(在Angular2上)迁移到webpack2。 这是我的网页包配置: 但我有一个错误: 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 longe
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'
}
}
我是个网页新手
也许我错了,我的问题出在:
let loadCKEDITOR = require('bundle-loader?lazy!exports?window.CKEDITOR!ckeditor/ckeditor')
您没有在配置中使用
导出加载程序
,但您指定了它:
如错误所示,这应该是导出加载程序
let loadCKEDITOR = require('bundle-loader?lazy!exports-loader?window.CKEDITOR!ckeditor/ckeditor')
let loadCKEDITOR = require('bundle-loader?lazy!exports-loader?window.CKEDITOR!ckeditor/ckeditor')