jspm

es6-module default export importing as undefined

那年仲夏 提交于 2019-12-10 13:26:43
问题 I'm not sure what I'm missing here. I'm working on a project using jspm and es6-module-loader. I've got an module defined as follows: import hooks from './hooks'; import api from './api'; import tools from './tools'; const StencilUtils = { hooks: hooks, api: api, tools: tools, }; export {hooks, api, tools}; export default StencilUtils; /* global define */ (function(root) { if (typeof define === 'function' && define.amd) { define(function() { return (root.stencilUtils = StencilUtils); }); }

Can I use JSPM without a transpiler?

天大地大妈咪最大 提交于 2019-12-10 12:43:46
问题 I am using jspm 0.16.2. I am using this test project When I set the Transpiler to none: transpiler: "none" I get an error XHR error (404 Not Found) loading http://localhost:53404/none.js If I set the transpiler to 'test' it gives the same error, except for it looks for test.js Is this a bug with jspm? I wanted to not use a transpiler, but use system.js to load AMD modules. When I removed the transpiler option from config.js, then it tries to load Traceur. I would like to not have a Transpiler

Using SystemJS/jspm to load async, es5 modules in production

倖福魔咒の 提交于 2019-12-10 02:26:34
问题 I want to be able to asynchronously load dependencies using System.import() , but without having to transpile ES6 to ES5 during production runtime. I want these modules to be transpiled into separate, ES5 modules that are fetched only when needed. I don't want them to be a part of the main bundle. Dev Workflow The modules are effectively loading during my production build which is actually worrisome because I don't want to include any dependencies that allow for transpilation. I have a

Importing CSS and controlling order in <head> using jspm and system.js

假如想象 提交于 2019-12-09 05:42:39
问题 I've written the following in an Aurelia app import "bootstrap/css/bootstrap.css!"; import "./app.css!"; and I want app.css second in since it overrides bootstrap.css styles. However, I'm getting app.css first since I presume the system.js loader is running them in parallel and since app.css is the smaller of the two it gets loaded first. Is there a way in jspm to define a dependency between these two files to control their loading order is is there some other way? Many thanks in advance! :)

how to fix 'jspm' is not recognized as an internal or external command, operable program or batch file

若如初见. 提交于 2019-12-08 16:27:37
问题 I install jspm in https://github.com/jspm/jspm-cli/wiki/Getting-Started. npm install jspm -g. It run. and I call it: jspm install, it not run,cmd notice "'jspm' is not recognized as an internal or external command, operable program or batch file." help me, please! 回答1: Adding %appdata%\npm in environment variables under PATH worked for me. 回答2: I was getting the same error and what I have tried and worked for me was to start cmd.exe as an administrator. Microsoft Windows [Version 6.1.7601]

Importing ElasticSearch into Aurelia

久未见 提交于 2019-12-08 08:56:53
问题 I'm trying to use elasticsearch-js within my Aurelia app but running into some trouble. After executing npm install elasticsearch , elasticsearch is installed under: app/node_modules/elasticsearch . In my app.js , I try to pull it in with import {elasticsearch} from 'elasticsearch'; and in the javascript console, I get the following error: system.src.js:4840 GET http://localhost:9000/dist/elasticsearch.js 404 (Not Found)D @ system.src.js:4840(anonymous function) @ system.src.js:4840Promise @

How to disable CSS imports in JSPM / SystemJS

浪子不回头ぞ 提交于 2019-12-08 08:54:32
问题 My issue is JSPM / SystemJS manually inserting CSS dependencies (namely Angular Material's CSS) when I have a different pipeline for those (Gulp + SASS). How can I tell JSPM to not import CSS files or interpret CSS dependencies in any way? I found only this discussion - https://github.com/jspm/jspm-cli/issues/791 - but it did not help me at all. 回答1: Seems that JSPM prefers local package overrides rather than turning off CSS features completely. The culprit of my original issue is Angular

Karma proxies are not working

时光毁灭记忆、已成空白 提交于 2019-12-07 15:00:48
问题 I am using Karma (v0.12.37) as test runner along with JSPM (v0.16.2) . I have added following proxy config in karma so as to allow proper loading of JSPM files: proxies: { '/base/jspm_packages/': '/base/app/jspm_packages/' } Bu this doesn't work out and fails on following: PhantomJS 2.0.0 (Windows 8 0.0.0) ERROR: 'Potentially unhandled rejection [10] Error: XHR error loading http://localhost:9876/base/jspm_packages/npm/babel-core@5.8.22.js Error loading http://localhost:9876/base/jspm

jspm does not transpile code from ES6 to ES5

两盒软妹~` 提交于 2019-12-07 08:25:18
问题 Running jspm bundle-sfx some/input some/output.js does not transpile my code from ES6 to ES5. This makes the output file unusable. Example contents of input file: [1,2,3,4].map((i)=>i*i); 回答1: As explained by jspm author here: ES6 transpilation only happens for ES6 modules, not ES6 files written in CommonJS. It means that transpilation happens only for files using module syntax ( import , export ). It can be forced though by adding "format es6"; at the top of the source file as so: "format

How to disable CSS imports in JSPM / SystemJS

拈花ヽ惹草 提交于 2019-12-06 16:54:03
My issue is JSPM / SystemJS manually inserting CSS dependencies (namely Angular Material's CSS) when I have a different pipeline for those (Gulp + SASS). How can I tell JSPM to not import CSS files or interpret CSS dependencies in any way? I found only this discussion - https://github.com/jspm/jspm-cli/issues/791 - but it did not help me at all. Seems that JSPM prefers local package overrides rather than turning off CSS features completely. The culprit of my original issue is Angular Material's package.json , which contains the following JSPM configuration: "shim": { "angular-material": {