browserify

use velocity template engine in js page

流过昼夜 提交于 2019-12-06 09:41:48
i know there's some nodejs modules to use apache velocity in node like those addresses in that question's response. could be done to use it as a, says, mustache replacement via, maybe, browserify.js? how would you do that as a workflow? I suspect it would be a better implementation on Liferay's frontend template development, so the frontender can serve to the java team html already velocity templating aware. Thanks a lot. You can directly use velocityjs on browser after using browserify on it. Installation First install velocityjs in your node_modules $> npm install velocityjs Now from your

browserify & factor-bundle dependency ids

♀尐吖头ヾ 提交于 2019-12-06 08:38:07
I'm using browserify and factor-bundle to manage dependencies, and in theory it should work great. We have different endpoints across pages, and running factor-bundle splits really quickly and efficiently for caching. The problem is that I'm running into this issue: https://github.com/substack/factor-bundle/issues/13 Unless there's a workaround, this appears to make factor-bundle completely useless until the issue is fixed. Is there a way to split off common dependencies manually in the interim? Or even a way to use factor-bundle at a reduced capacity? EDIT This is my current gulp build script

Trouble including slick-carousel with global jQuery using Browserify / Browserify Shim

北慕城南 提交于 2019-12-06 08:26:10
I'm using Browserify 11.2 and Browserify Shim 3.8 and am attempting to utilize slick-carousel (included via npm) with a jQuery loaded from a CDN. I realize that this requires the use of Browserify shim, but I am unable to get it to work. Here is the relevant portion of my package.json file. "devDependencies": { ... "browserify": "^11.2.0", "browserify-shim": "^3.8.10", ... "slick-carousel": "^1.5.8", ... }, "browserify": { "transform": [ "browserify-shim" ] }, "browser": { }, "browserify-shim": { "jquery": "global:jQuery", "slick-carousel": { } }, "dependencies": { } When attempting to require

Browserify with Zurb Foundation Framework

两盒软妹~` 提交于 2019-12-06 07:14:07
问题 POST-SOLUTION EDIT Here's a Yeoman generator to scaffold out a project with Foundation and Browserify: https://github.com/dougmacklin/generator-foundation-browserify I'm trying to figure out how to properly bundle the foundation framework js with browserify. In my project folder, I install it along with jQuery (which it depends on): npm install jquery foundation-sites --save Then in my main.js I have the following: var $ = jQuery = require('jquery'); var foundation = require('foundation-sites

ES6 编译 ES5 环境搭建

旧时模样 提交于 2019-12-06 07:08:53
目录结构 scripts main.es6 products.es6 temp gulpfile.js package.json index.html 文件内容 package.json { "devDependencies": { "browserify": "^11.2.0", "gulp": "^3.9.0", "gulp-babel": "^5.2.1", "gulp-buffer": "0.0.2", "gulp-clean": "^0.3.1", "gulp-uglify": "^1.4.1", "vinyl-source-stream": "^1.1.0" } } gulpfile.js var gulp = require('gulp'), babel = require('gulp-babel'), browserify = require('browserify'), source = require('vinyl-source-stream'), buffer = require('gulp-buffer'), uglify = require('gulp-uglify'), clean = require('gulp-clean') ; gulp.task('help', function () { console.log( `使用帮助: gulp

Chain Gulp glob to browserify transform

只谈情不闲聊 提交于 2019-12-06 05:51:34
问题 I have a project with a few relatively disjoint pages, each including their own entry point script. These scripts require a number of others using commonjs syntax, and need to be transformed by 6to5 and bundled by browserify. I would like to set up a gulp task that captures all the files matching a pattern and passes them on to the bundler, but I'm not sure how to pass files from gulp.src to browserify(filename) . My gulpfile looks like: var gulp = require("gulp"); var browserify = require(

Gulp, Reactify, and Babelify not transforming together

不羁岁月 提交于 2019-12-06 01:37:31
问题 This is my gulpfile code: gulp.task('react', function () { browserify('app/src/main.jsx') .transform(reactify) .transform(babelify) .bundle() .pipe(source('app.js')) .pipe(streamify(uglify())) .pipe(gulp.dest('dist/js/')); }); Only the first transform statement runs, and therefor throws an error due to the lack of additional transform (I'm writing in ES6 and JSX w/ react). I'm at a complete loss and would really appreciate help. 回答1: Reactify should no longer be used. You don't say what

Using Browserify with JQuery - what does it 'really' mean?

做~自己de王妃 提交于 2019-12-05 23:50:11
New to javascript, etc. I wanted to do a pure HTML/Javascript project. I looked at requireJS, and from what I read, it seemed to me that a few projects went through the pain of switching their requireJS project to node/browserify projects. So I thought I just start with a node/browserify project. My limited understanding is that when you browserify a project, it basically packages the dependencies along with your javascript. Couple of questions Does it create just one file? If it creates multiple files, then what happens if multiple files depend on the same project (such as lodash)? Does it

How do I properly separate my app.js and vendor.js bundles using Browserify?

家住魔仙堡 提交于 2019-12-05 21:42:59
My goals are to include the following in my HTML file and have them all work properly: index.html: <script type="text/javascript" src="./vendor.js"></script> <script type="text/javascript" src="./app.js"></script> $(document).ready(function() { // jQuery should be available as `window.$` $(".myclass").doSomethingWithJquery(); } <div class="row"> <h1 class="col-md-3 col-md-offset-3"> I should be able to use bootstrap, including bootstrap's javascript libraries, in my templates </h1> </div> <!-- I should be able to use app.js, with its various require('module') statements and attach rendered

Adding bootstrap.js to browserify?

拈花ヽ惹草 提交于 2019-12-05 20:17:50
问题 So I am trying to figure out how to do this? I downloaded bootstrap-sass via bower and added the bootstrap javascript into a shim. A few things have me confused, the bootstrap.js file looks like this. //= require bootstrap/affix //= require bootstrap/alert //= require bootstrap/button //= require bootstrap/carousel //= require bootstrap/collapse //= require bootstrap/dropdown //= require bootstrap/tab //= require bootstrap/transition //= require bootstrap/scrollspy //= require bootstrap/modal