jsoverson / preprocess

Preprocess HTML, JavaScript, and other files with directives based off custom or ENV configuration
Other
366 stars 80 forks source link

Support for option.alias for define file load path. #133

Open Akimyou opened 6 years ago

Akimyou commented 6 years ago

Usage

// a<!--@include @static.txt-->c
preprocess.preprocess(input, {}, { alias: { '@': 'test/fixtures/include/' } })
preprocess.preprocess(input, {}, { alias: { '@': path.join(__dirname, 'fixtures/include/') } }).should.equal("a!bazqux!c");

Node

Alias value must be a dir path.

Test

Coverage summary before 704d2898

Statements : 96.8% ( 242/250 ) Branches : 86.15% ( 112/130 ) Functions : 100% ( 33/33 ) Lines : 97.57% ( 241/247 )

Coverage summary after

Statements : 96.93% ( 253/261 ) Branches : 86.23% ( 119/138 ) Functions : 100% ( 33/33 ) Lines : 97.67% ( 252/258 )

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 97.674% when pulling 6de9b001edea7107f2bacd6bec136951680625d1 on Akimyou:feature/include_alias into 704d28987837f38abcd6b2e07ba65928e43f2983 on jsoverson:master.

Akimyou commented 6 years ago

The same problem !

127