0.0.3 • Published 4 years ago
@k2omni/gulp-shopify-script-preprocessor v0.0.3
gulp-shopify-script-preprocessor
Getting Started
- Add the K2O registry into the
.npmrc
in your package
@k2o:registry=http://159.65.102.149:8081/repository/npm-private
- Install dependency:
$ npm install --save-dev @k2o/gulp-shopify-script-preprocessor
- In your
gulpfile.js
:
const shopifyScriptPreprocessor = require('@k2o/gulp-shopify-script-preprocessor');
const concat = require('gulp-concat');
gulp.task('js', function() {
gulp.src(['app/assets/js/main.js'])
.pipe(shopifyScriptPreprocessor())
.pipe(concat())
.pipe(gulp.dest('dest/assets/js/'));
});
- In your
js
files:
/*
* @shopify {% if template == 'product' %} <%= script %> {% endif %}
*/
let a = (function () {
return (a, b) => a + b;
})()
console.log(a(1, 2))
0.0.3
4 years ago