patternplate-transform-resolve-imports
patternplate transform pattern dependency imports to interoperable paths
Last updated 3 years ago by marionebl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install patternplate-transform-resolve-imports 
SYNC missed versions from official npm registry.

patternplate-transform-resolve-imports

patternplate transform pattern dependency imports to interoperable paths.

Installation

npm install --save patternplate-transform-resolve-imports

Transformation

Input

// foo/bar/foo/index.js
import foo from 'bar';
require('baz');
// foo/bar/foo/pattern.json
{
	"name": "foo",
	"patterns": {
		"bar": "foo/bar/baz",
		"baz": "baz/bar/foo"
	}
}

Output

import foo from '../baz/index.js';
require('../../baz/bar/index.js');

Parameters

// configuration/patternplate-server/transforms.js
module.exports = {
	'resolve-imports': {
		'outFormat': 'js'
	}
}

Copyright 2016 by SinnerSchrader Deutschland GmbH and contributors. Released under the MIT license.

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

3 Versions

  • 1.0.0                                ...           3 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |