exuanbo / gulp-inline-source-html Goto Github PK
View Code? Open in Web Editor NEWInlines flagged js, css, and img sources in html with inline-source
License: MIT License
Inlines flagged js, css, and img sources in html with inline-source
License: MIT License
Hi there this is a long shot but, hope someone can help,
I am using gulp-inline-source-html (https://github.com/exuanbo/gulp-inline-source-html) & gulp-nunjucks-render (https://github.com/carlitoplatanito/gulp-nunjucks-render) plus browserSync to show the updated UI
The plugin does something, but the problem is i don't think it properly writes the file, only when I do a hard refresh the UI is updated.
gulpfile.js
pipe(nunjucksRender({ path: njkPaths, ext: "", data: ENV_VARS, envOptions: { trimBlocks: true, lstripBlocks: true } })) .pipe(inlineSource({ compress: false, saveRemote: true, handlers: [require("./nunjucksHandler.js")] ?? }))
I was trying the precompile approach popeindustries/inline-source#70 (comment) but got nowhere.
nunjucksHandler.js
const Nunjucks = require('nunjucks'); module.exports = function nunjucks(source, context) { return new Promise((resolve, reject) => { if ( source.fileContent && !source.content && source.type == "text/css" ) { let content; try { content = Nunjucks.precompile(source.fileContent); } catch (err) { return reject(err); } // Need to expose templates for later use somehow... source.content = content } resolve(); }); };
.nunjucks
...
<link inline href="{{ENV_PARTIALS_BASE_PATH}}/common/terms-and-conditions/index.css" rel="stylesheet"/>
<section>html</section>
{% somenunjucks syntax etc %}
...
Thanks
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | eslint-plugin-node |
|
npm | eslint-plugin-standard |
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
package.json
inline-source ^7.2.0
plugin-error ^1.0.1
through2 ^4.0.0
@rollup/plugin-commonjs 16.0.0
chai 4.2.0
eslint 7.18.0
eslint-config-prettier 6.15.0
eslint-config-prettier-standard 3.0.1
eslint-config-standard 16.0.2
eslint-plugin-import 2.22.1
eslint-plugin-node 11.1.0
eslint-plugin-prettier 3.3.1
eslint-plugin-promise 4.2.1
eslint-plugin-standard 4.1.0
mocha 8.2.1
prettier 2.2.1
prettier-config-standard 1.0.1
rollup 2.37.1
vinyl 2.2.1
.travis.yml
node 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.