Skip to content

hakamaq/gulp-export-html

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-export-html

A gulp plugin for converting html files into string then export using ES6 modules. Helpful to import css in js or html to js.

Modified repo you can find original here https://github.com/tommaton/gulp-css-to-polymer

Install

npm

$ npm install --save-dev gulp-css-to-polymer

yarn

$ yarn add gulp-css-to-polymer

Examples

const stringlize = require('gulp-export-html');

// Wrap css files
gulp.task("polymerize", () => {
    gulp.src("./src/**/*.css")
        .pipe(stringlize({
            prefix: 'tg-',
            suffix: '-styles'
            concat: 'template.js'
        }))
        .pipe(gulp.dest("./dist"));
}

Options / Defaults

{
    // string to be used for the beginning of the file name & module ids.
    prefix: 'tg-',
    // string to be used for the end of the file name & module ids.
    suffix: '-styles',
    //Merges all export const in one file and adds export default object at then end of the file
    concat: 'template.js'
}

LICENSE MIT

About

Converting HTML to a ES6 Module Export

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%