Skip to content

Commit 8767f44

Browse files
swernerxMoOx
authored andcommitted
Fixed: JSPM support (#194)
* Added support for alternate sugar syntax * Added jspm capable package resolver * Ignoring jspm packages * Added basic jspm config for new version * Made jspm a direct dependency for testing * Added basic integration for jspm based resolver * Ignoring linting for jspm mostly generated config files * Updated for jspm resolver * Fixed for eslint formatting check * Ignore non-project files * Reverting adding .sss extensions. * Moving jspm dep to dev-dependencies * Cleanup of some unneeded jspm related files * Removed empty map data * Do not need direct jspm dependency
1 parent d6c8b83 commit 8767f44

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
test/fixtures/*.actual.css
3+
jspm_packages

lib/resolve-id.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var resolve = require("resolve")
2+
var jspmResolve = require("pkg-resolve")
23

34
var moduleDirectories = [
45
"web_modules",
@@ -39,6 +40,12 @@ module.exports = function(id, base, options) {
3940
.catch(function() {
4041
return resolveModule(id, resolveOpts)
4142
})
43+
.catch(function() {
44+
return jspmResolve.default(id, {
45+
basedir: resolveOpts.basedir,
46+
extensions : resolveOpts.extensions,
47+
})
48+
})
4249
.catch(function() {
4350
if (paths.indexOf(base) === -1) {
4451
paths.unshift(base)

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
],
2020
"dependencies": {
2121
"object-assign": "^4.0.1",
22+
"pkg-resolve": "^0.1.7",
2223
"postcss": "^5.0.14",
2324
"postcss-value-parser": "^3.2.3",
2425
"read-cache": "^1.0.0",
@@ -31,6 +32,14 @@
3132
"npmpub": "^3.0.1",
3233
"postcss-scss": "^0.1.3"
3334
},
35+
"jspm": {
36+
"name": "postcss-import",
37+
"main": "index.js",
38+
"browser": {
39+
"./lib/load-content": "@empty",
40+
"./lib/resolve-id": "@empty"
41+
}
42+
},
3443
"scripts": {
3544
"lint": "eslint --fix .",
3645
"pretest": "npm run lint",
@@ -39,11 +48,5 @@
3948
},
4049
"eslintConfig": {
4150
"extends": "eslint-config-i-am-meticulous/es5"
42-
},
43-
"jspm": {
44-
"browser": {
45-
"./lib/load-content": "@empty",
46-
"./lib/resolve-id": "@empty"
47-
}
4851
}
4952
}

0 commit comments

Comments
 (0)