You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gulp plugin for Lasso.js.
Replaces references to scripts or stylesheets into a set of HTML files.
Usage
First, install gulp-lasso as a development dependency:
npm install --save-dev gulp-lasso
Then, add it to your gulpfile.js:
varlasso=require('gulp-lasso');gulp.task('lasso',function(){gulp.src(['src/**/*.html']).pipe(lasso({"configFile": "./lasso-config.json",//Path to a JSON lasso configuration file"dependencies": ["./src/css/style.css","./src/css/style.less","./js/libs/react/react.js","./src/jsx/main.jsx","require-run: ./src/js/main"],"plugins": ["lasso-less","lasso-jsx"],"mode": 'production'})).pipe(gulp.dest('build'));});
Create the lasso config file:
lasso-config.json:
{"plugins": [],// plugins can be specified here, or can be overridden in the gulpfile.js"fileWriter": {"outputDir": "build/static","fingerprintsEnabled": false,"urlPrefix": "static/"},"minify": true,"resolveCssUrls": true,"bundlingEnabled": true}
Run the following command to generate the concatenated, minifed css, js files inside static folder and references of those files are added into the html files: