Giter Site home page Giter Site logo

Comments (4)

lepture avatar lepture commented on June 9, 2024

我们是这样子做的,每一个 app 都当作一个模块,然后用 https://github.com/spmjs/spm-build 来构建的。

spm-build 本质上来说就是内置了一套 Gruntfile 的配置,如果你的每个 app 的构建过程是一致的,可参考 spm-build。

from grunt-cmd-transport.

huanglong-zz avatar huanglong-zz commented on June 9, 2024

不明觉厉。

我建了个测试的目录结构如下:

  ├── app
  │   └── cs
  │       └── src
  │           ├── index.js
  │           └── waterflow.js
  ├── base
  │   ├── libs
  │   │   ├── seajs
  │   │   │   ├── 1.1.0
  │   │   │   │   ├── plugin-base.js
  │   │   │   │   ├── plugin-coffee.js
  │   │   │   │   ├── plugin-json.js
  │   │   │   │   ├── plugin-less.js
  │   │   │   │   ├── plugin-map.js
  │   │   │   │   ├── plugin-text.js
  │   │   │   │   ├── sea-debug.js
  │   │   │   │   └── sea.js
  │   │   │   └── 1.2.0
  │   │   │       ├── plugin-base.js
  │   │   │       ├── plugin-coffee.js
  │   │   │       ├── plugin-json.js
  │   │   │       ├── plugin-less.js
  │   │   │       ├── plugin-map.js
  │   │   │       ├── plugin-text.js
  │   │   │       ├── sea-debug.js
  │   │   │       └── sea.js
  │   │   └── zepto
  │   │       └── 1.0.0
  │   │           ├── zepto-debug.js
  │   │           └── zepto.js
  │   ├── styles
  │   │   └── component
  │   │       └── slider
  │   │           └── js
  │   │               └── slider.js
  │   └── utils
  │       └── css3
  │           └── css3.js
  └── package.json

其中 index.js 依赖 zepto.js slider.js,slider.js 依赖 css3.js

package.json 如下:

  {
    "family": "M2UX",
    "version": "1.2.0",
    "name": "cs",
    "description": "Mobile Projects: cs",
    "spm": {
      "source": "app",
      "idleading": "mobile/cs/",
      "output": ["index.js", "waterflow.js"],
      "alias": {
        "zepto": "base/libs/zepto/1.0.0/zepto.js"
      },
      "engines": {
        "seajs": "base/libs/seajs/1.2.0/sea.js"
      }
    },
    "private": true
  }

环境:

spm: 2.1.2
node: v0.10.6

在 spm build 时,transport 找不到依赖:

  Task: "transport:src" (transport) task
  warn: can't find module base/libs/zepto/1.0.0/zepto.js
  warn: can't find module base/libs/zepto/1.0.0/zepto.js
  warn: can't find module base/libs/zepto/1.0.0/zepto.js
  warn: can't find module base/libs/zepto/1.0.0/zepto.js
  warn: can't find module base/libs/zepto/1.0.0/zepto.js

一定是我哪里写不对,麻烦指导一下,多谢。

项目在这里:[email protected]:huanglong/spm-out.git

from grunt-cmd-transport.

popomore avatar popomore commented on June 9, 2024

如果要用 spm-build,需要有严格的目录结构,依赖的必须放到 sea-modules 下,你可以

spm install zepto/zepto

from grunt-cmd-transport.

popomore avatar popomore commented on June 9, 2024

没有回复,先关了

from grunt-cmd-transport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.