patternplate-transform-resolve-imports
v1.0.0
Published
patternplate transform pattern dependency imports to interoperable paths
Downloads
84
Readme
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.