Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行出现错误:Uncaught [ModJS] Cannot find module components/jquery/jquery #1

Open
pgtoxx opened this issue Nov 15, 2017 · 0 comments

Comments

@pgtoxx
Copy link

pgtoxx commented Nov 15, 2017

执行初始化项目 fis3 init components-demo,然后 发布项目和启动服务后,出现错误:

Uncaught [ModJS] Cannot find module `components/jquery/jquery`

最后找到原因了,

错误一

在文件 fis-conf.js

// npm install [-g] fis3-hook-module
// 引入模块化开发插件,设置规范为 commonJs 规范。
fis.hook('module', {
    mode: 'commonJs'
});

应该修改为

// npm install [-g] fis3-hook-module
// 引入模块化开发插件,设置规范为 commonJs 规范。
fis.hook('commonjs');

错误二

fis.match('::packager', {
    // npm install [-g] fis3-postpackager-loader
    // 分析 __RESOURCE_MAP__ 结构,来解决资源加载问题
    postpackager: fis.plugin('loader', {
        resourceType: 'commonJs',
        useInlineMap: true // 资源映射表内嵌
    })
});

将代码中的packager改成package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant