spmjs / docs Goto Github PK
View Code? Open in Web Editor NEWDocuments for spm 3.6 and above.
Documents for spm 3.6 and above.
按照说的步骤走,打开浏览器一运行,就报require 未定义,require不是全局函数吗?
可能是个低级问题,但真的是很令人头疼
D:\spm\test>spm install seajs
C:\Users\PC\AppData\Roaming\npm\node_modules\spm\node_modules\co\index.js:50
return new Promise(function(resolve, reject) {
^
ReferenceError: Promise is not defined
at co (C:\Users\PC\AppData\Roaming\npm\node_modules\spm\node_modules\co\index.js:50:14)
at createPromise (C:\Users\PC\AppData\Roaming\npm\node_modules\spm\node_modules\co\index.js:30:15)
at Object. (C:\Users\PC\AppData\Roaming\npm\node_modules\spm\bin\spm-install:43:1)
at Module.compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
我在执行 spm install seajs 时一直报这个错误,不知道怎么回事。我用npm cnpm都试过重新安装 spm,但还是不成,求教@@
require用绝对路径怎么办 可以指定root吗 我在构建配置里面没有看到类似的选项
require('/module/A');
配置输出文件名是否带 hash 后缀。
我开启了 hash
最终生成了 index-2b7f66baa43cdf4d6016.js
文件。
但是没有生成类似 map.json
的文件
// map.json
{
"file":{
"index.js": "index-2b7f66baa43cdf4d6016.js"
}
}
根据get-started的步骤来,发现在执行 spm doc
后,浏览访问,静态文件是没有的,还需要执行什么?
static
文件不存在
'c:\Users\chenlai_0011\AppData\Roaming\npm\node_modules\spm\node_modules\mocha-phantomjs\bin\mocha-phantomjs' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
{ code: 1,
stderr: ''c:\Users\chenlai_0011\AppData\Roaming\npm\node_modules\spm\node_modules\mocha-phantomjs\bin\mocha-phantomjs' �����ڲ����ⲿ���Ҳ���ǿ����еij���\r\n���������ļ���\r\n' }
在项目入门里
touch index.html index.js
提示 touch 不是内部或外部命令。。。
spm -v
3.9.0-beta3
spm init 无命令,请求更新文档
afc163 commented on 16 Mar
使用此方式我需要将每个所需模块都执行一次 spm build -O ../../../spm 是否有快捷方法可以一次性将 spm_modules/ 所有文件全部 build ?
目前可以使用 spm build --with-deps 来打包依赖模块,同样会输出到 dist 目录中。
spm install dzoom
cd spm_modules/dzoom/0.0.1/
spm build --with-deps
error: unknown option `--with-deps'
less的map文件最终指向生成的css文件。
这个webpack也是无法追踪,或许有什么办法能够解决。
无论用什么方法,spm都无法安装成功……
just the title,
like npm config
http-proxy
https-proxy
如题,没法玩
"output": [
"./app//."
],
html文件在app目录下,server启动后,只要html有改动,立即异常:
changed: app\test1.html
path.js:200
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at f (path.js:200:13)
at Object.filter (native)
at win32.join (path.js:205:38)
at copyFile (C:\Program Files\nodejs\node_modules\spm\node_modules\spm-webpa
ck\lib\SPMPlugins.js:110:16)
at copyFiles (C:\Program Files\nodejs\node_modules\spm\node_modules\spm-webp
ack\lib\SPMPlugins.js:99:5)
at copy (C:\Program Files\nodejs\node_modules\spm\node_modules\spm-webpack\l
ib\SPMPlugins.js:43:7)
at EventEmitter. (C:\Program Files\nodejs\node_modules\spm\node_m
odules\spm-webpack\lib\SPMPlugins.js:37:11)
at EventEmitter.emit (events.js:110:17)
at EventEmitter. (C:\Program Files\nodejs\node_modules\spm\node_m
odules\chokidar\index.js:136:15)
at EventEmitter.FSWatcher._emit (C:\Program Files\nodejs\node_modules\spm\no
de_modules\chokidar\index.js:152:5)
spm init, spm test等都不能用
spm版本:3.9.0-beta3
node版本:v0.10.30
很多配置项都没有写得很明确,想问反向代理如何配置。
比如我有下面这样的工程,要怎么构建啊
view
|--page1
|--index.html
|--page2
|--index.html
static
|--page1
|--index.js
|--index.css
|--page2
|--index.js
|--index.css
|--index.png
package.json
之前没用过spm,对spm不是很了解,spm是不是只用来构建js的?用spm来构建项目时,对项目目录,各资源的排放有要求吗?
spmjs和seajs的文档中多次链接到spmjs.io的网站,对于学习seajs和spmjs造成了一定的困扰, 十分好奇为什么要把这个网站关闭呢?
先赞一个这个文档项目,更简单易懂了。
{
"spm": {
"output": [
"*.js"
],
"dependencies": {
"jquery": "~2.1.3"
}
}
}
$ spm build --watch
修改 a.js 会出现如下消息
generated: a.js 83.17kB
build: done
build: compile
generated: b.js 83.17kB
generated: index.js 83.17kB
generated: a.js 83.17kB
build: done
build: compile
generated: b.js 83.17kB
generated: index.js 83.17kB
generated: a.js 83.17kB
build: done
我如何控制修改时只build当前 a.js 文件。
spm build --watch
的调试速度比 spm server
慢很多。可以通过某种方式提速么?
再请教一个问题:
$ spm build index.js index.html
我能用 gulp 调用 spm build index.js index.html
命令么?
我可能需要 build 完了会接着做一些其他操作。
spm 提供一些对外的接口,利用这些接口与其他模块结合。构建一整套的前端工作流程。
var spm = require('spm')
spm.build('index.js').on('done',function(){
// .. somecode
})
spm doc
打开 demo 页面,Cannot find module "../index.js"
并且 alert undefined
XMLHttpRequest cannot load http://127.0.0.1/socket.io/?EIO=3&transport=polling&t=1435648320497-2. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 404.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.