sindresorhus / gulp-nunjucks

Precompile Nunjucks templates
MIT License
152 stars 20 forks source link

Extension remains .html when running precompile #26

Closed froddd closed 6 years ago

froddd commented 6 years ago

The example given for precompile creates the file dist/greeting.html instead of dist/greeting.js.

sindresorhus commented 6 years ago

That's weird. The tests are passing with .js extension: https://github.com/sindresorhus/gulp-nunjucks/blob/809cea0a7eb43975ee9a6071ee2be811d7d27d3d/test.js#L12 Maybe try rm -rf node_modules && npm install

froddd commented 6 years ago

rm -rf node_modules && npm install doesn't fix it, unfortunately.

Is setting the extension using file.extname = '.js' a Vinyl-only thing? https://github.com/gulpjs/vinyl#fileextname

Created a pull request which actively updates the file path: https://github.com/sindresorhus/gulp-nunjucks/pull/27