-
Notifications
You must be signed in to change notification settings - Fork 180
SPM 3.6 FAQ 整理 #1316
Comments
error: Module not found: Error: a dependency to an entry point is not allowed
|
error: Module build failed: Error: Didn't get a result from child compiler
/* webpack */
@import '~normalize.css';
/* spm 3.6以往 */
@import 'normalize.css';
ex. @import (css) '~normalize.css';
@import (css) '../css/common.css';
@import (css) '~alice-button'; 注意:less引入的模块需要声明类型 |
error: Module not found: Error: Cannot resolve 'file' or 'directory' ./tpl.handlebars in $CWD/src
Precompile <!-- defalut.handlebars -->
<div>
<span>{{name}}</span>
<span>{{content}}</span>
</div> Then require it in js file. var source = require('./defalut.handlebars');
var result = source({
name: 'alex',
content: 'content'
});
console.log(result);
Realtime Compile <!-- defalut.tpl -->
<div>
<span>{{name}}</span>
<span>{{content}}</span>
</div> Then require it in js file. var Handlebars = require('handlebars');
var source = require('./tpl/tpl.tpl');
var template = Handlebars.default.compile(source);
var result = template({
name: 'alex',
content: 'content'
});
console.log(result); |
该问题已经修复
该问题已经解决,请升级到[email protected] |
稍后补充 |
handlebars 用 partials 的问题 form.js 有如下调用:
form.handlebars 含有如下代码
spm build 后会报如下错误 Module build failed: Error: Partial 'groups' not found |
@lynzz 参考这个,https://github.com/spmjs/spm/issues/1269#issuecomment-99016169,用 spmhandlebars-loader 。 |
@sorrycc 可以了,谢谢 |
[email protected] 后,这个问题不会再出现了。 |
原有代码通过
|
原有的jQuery插件模块,在升级spm3.6后,业务代码中使用
此时webpack会讲require的所有 |
SPM 3.6 FAQ 整理
The text was updated successfully, but these errors were encountered: