A gulp plugin for wrapping css files into ES6 modules as used by Polymer
$ npm install --save-dev gulp-css-to-polymer
$ yarn add gulp-css-to-polymer
const polymerizeCSS = require('gulp-css-to-polymer');
// Wrap css files
gulp.task("polymerize", () => {
gulp.src("./src/**/*.css")
.pipe(polymerizeCSS({
prefix: 'tg-',
suffix: '-styles',
pwa: true
}))
.pipe(gulp.dest("./dist"));
}
{
// 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',
// boolean, determines how the styles are generated as differentate between Polymer and Polymer PWA
pwa: true // default is false,
}