每当我试图运行生产构建命令npm run build或npx parcel build index.html时,我都会得到这个错误。我有一个简单的html和css项目,没有反应,没有第三方库,为什么会发生这种情况?我试过1.12.3、1.12.4和1.12.5版本的包裹。
以下是错误:
/Users/user/Documents/HTML Apps/Project/index.html: tree.render is not a function
at /Users/user/Documents/HTML Apps/Project/node_modules/htmlnano/lib/modul
我正在尝试导入一个用api.js实现的js库,如下所示:
var api = (function() {
function _logon() {
return "You logged on";
}
return {
logon: _logon
};
}());
在我尝试过的vue文件脚本标记中:
import * as api from '../api.js'
//and
import api from '../api.js'
export d
我想建立一个API。我的应用程序是meteor/nodejs应用程序。因此,我在public文件夹中创建了一个api.js文件:
document.write({ example: 'Lorem ipsum' });
我希望通过调用localhost:3000/api.js获得对象作为输出,但我看到的却是源代码。
第二个问题:
如何处理参数?例如localhost:3000/api.js?type=article
const type = get[type]; // should be 'article' in this example
使用路由将呈现HTML内
我在appcenter上的预编译脚本有问题。Appcenter对预编译脚本使用bash。我想在我的api.js文件中将"qa.api“更改为"beta.api”。
我尝试了以下方法,但似乎不起作用:
#!/usr/bin/env bash
if [ "$APPCENTER_BRANCH" != "master" ];
then
cd App/Services/
echo "changing QA API to Production API (beta)"
sed -i 's/qa.api/beta.
当我试图查看html文件以进行更改时,我收到了以下错误:
C:\Users\sjsui\Desktop\git_workshop\MoonMachineOpenSource\MoonMachine\MoonMachine2\Front\templates>parcel watch index.html
× C:\Users\sjsui\Desktop\git_workshop\MoonMachineOpenSource\MoonMachine\MoonMachine2\Front\templates\index.html: URI malformed
at decodeURICompo
我有外部的这个api模块。当它作为一个node_module安装时(使用npm ),然后执行类似的导入工作:
import MyAPI from 'api'
但是,当我查看node_modules中的api文件夹并取出api.js (这是模块的入口点)时,执行如下所示的相对导入:
import MyAPI from './api.js'
然后我得到了错误:
"The requested module ./api.js does not provide an export named 'default'"
我无法控制api模块是如何