jspm / jspm-cli

ES Module Package Manager
https://jspm.org
Apache License 2.0
3.78k stars 272 forks source link

project tree problem #1823

Closed shaoahs closed 8 years ago

shaoahs commented 8 years ago

if create new project like this

<project root path>
├── package.json
└── web
    ├── <folder name>
    │   └── group
    │       └── test
    │           └── main.js
    ├── index.html
    ├── jspm.browser.js
    └── jspm.config.js

main.js console.log("test log !"); package.json

{
  "jspm": {
    "name": "test",
    "main": "main",
    "directories": {
      "baseURL": "web"
    },
    "devDependencies": {
      "plugin-babel": "npm:systemjs-plugin-babel@^0.0.10"
    }
  },
  "devDependencies": {
    "jspm": "^0.17.0-beta.14"
  }
}

jspm.browser.js


SystemJS.config({
  baseURL: "./",
  paths: {
    "npm:*": "jspm_packages/npm/*",
    "test/": "<folder name>/group/test/"
  },
  bundles: {
    "build.js": [
      "<folder name>/group/test/main.js"
    ]
  }
});

<folder name> can use any name , but can't use 'src' use jspm bundle <folder name>/group/test/main.js has error why?

guybedford commented 8 years ago

What is the error you are getting here? Do you mean it works in every case except when folder name is src?

shaoahs commented 8 years ago

create new project like this

Package.json file does not exist, create it? [Yes]: Yes
Init Mode (Quick, Standard, Custom) [Quick]: Standard
Local package name (recommended, optional): app
package.json directories.lib [src]: web/<folder name>
package.json directories.baseURL (optional): web
package.json directories.packages [web/jspm_packages]: web/jspm_packages
System.config browser baseURL (optional): ./
System.config browser URL to web/<folder name>  [ <folder name> ]: <folder name>
System.config browser URL to web/jspm_packages [web/jspm_packages]: web/jspm_packages
System.config local package main [app.js]: app.js
System.config local package format (esm, cjs, amd): amd
System.config transpiler (Babel, Traceur, TypeScript, None) [babel]: babel
<folder name> if type 'src' , then
jspm bundle <folder name>/main.js

error message

[dott@localhost t03]$ jspm bundle src/main.js     
     Building the bundle tree for src/main.js...

err  Error on translate for app/main.js at file:///home/dott/html/javascript/astro/proj/t03/web/src/main.js
  TypeError: plugin-babel cannot transpile amd modules. Ensure "file:///home/dott/html/javascript/astro/proj/t03/web/src/main.js" is configured not to use this loader.
    at SystemJSNodeLoader.exports.translate (file:///home/dott/html/javascript/astro/proj/t03/web/jspm_packages/npm/systemjs-plugin-babel@0.0.10/plugin-babel.js:68:11)
    at SystemJSNodeLoader.<anonymous> (/home/dott/html/javascript/astro/proj/t03/node_modules/systemjs/dist/system.src.js:4462:69)
    at SystemJSNodeLoader.<anonymous> (/home/dott/html/javascript/astro/proj/t03/node_modules/systemjs/dist/system.src.js:4853:24)
    at /home/dott/html/javascript/astro/proj/t03/node_modules/systemjs-builder/lib/trace.js:430:25
    at tryCatcher (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:628:18)
    at Promise._resolveCallback (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:423:57)
    at Promise._settlePromiseFromHandler (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:514:17)
    at Promise._settlePromise (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/dott/html/javascript/astro/proj/t03/node_modules/bluebird/js/release/promise.js:628:18)
guybedford commented 8 years ago

And what is the contents of file:///home/dott/html/javascript/astro/proj/t03/web/src/main.js?

shaoahs commented 8 years ago

only console.log("test log");

guybedford commented 8 years ago

This should be working better in the latest jspm 0.17 release. Let me know if you're still having issues.

supporter-bot commented 8 years ago

If the support you've received on this issue has helped your project, perhaps consider leaving a tip for the maintainer.

Donate to the project via SupporterHQ.