pkg-resolve

Front-end Oriented Package Resolver for JSPM/NPM Packages

Apache-2.0 18 个版本
安装
npm install pkg-resolve
yarn add pkg-resolve
pnpm add pkg-resolve
bun add pkg-resolve
README
JSPM Logo

Package Resolve
Sponsored by Version Downloads Build Status Dependencies

Package Resolver (JSPM+NPM) which supports JavaScript and CSS packages. Preferes ES6 Module files following jsnext:main flag in package configuration. Also respects alternative style entries as main package entry point.

The solution was mainly thought for offering a powerful JSPM-capable include mechanism for PostCSS.

Installation

Should be installed locally in your project source code:

npm install pkg-resolve --save-dev

Usage

Integrate like this in your e.g. gulpfile.js or other packages:

import resolver from "pkg-resolve"

resolver("lodash/map").then((path) => {
  console.log("Path of lodash/map implementation:", path)
});

resolver("normalize.css").then((path) => {
  console.log("Path of normalize.css main entry:", path)
});

Usage for PostCSS

You are also able to combine the import functionality with PostCSS Import. That's pretty neat to include CSS files and other referenced assets which are installed with JSPM inside the local project.

  1. Install normalize.css: jspm install npm:normalize.css
  2. Include it via PostCSS include: @import "normalize.css";
Sebastian Software GmbH Logo

Copyright 2016
Sebastian Software GmbH

版本列表
0.2.2 2016-05-25
0.2.1 2016-05-25
0.2.0 2016-05-25
0.1.14 2016-05-20
0.1.13 2016-05-10
0.1.12 2016-05-10
0.1.11 2016-05-05
0.1.10 2016-05-04
0.1.9 2016-05-04
0.1.8 2016-05-04
0.1.7 2016-04-20
0.1.6 2016-04-20
0.1.5 2016-04-18
0.1.4 2016-04-18
0.1.3 2016-04-18
0.1.2 2016-04-18
0.1.1 2016-04-15
0.1.0 2016-04-15