browserify

Gulp + babelify + browserify issue

◇◆丶佛笑我妖孽 提交于 2019-12-21 02:44:17
问题 I'm trying to create a gulp task with browserify and babelify. Here is the task: var gulp = require('gulp'); var browserify = require('gulp-browserify'); var source = require('vinyl-source-stream'); var babelify = require('babelify'); gulp.task('js', function () { browserify('./resources/js/*.js') .transform(babelify) .bundle() .pipe(source('*.js')) .pipe(gulp.dest('./public/js')); }); I found a few sample code, tried to use them, but the result was always the same. When i run the task, and

css模块的解决办法 演进

↘锁芯ラ 提交于 2019-12-20 15:22:55
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1. 手动分模块, (早期办法 ,这样容易相互覆盖,冗余代码,嵌套过深) 刀耕火种的时代了 2. css预处理 (sass/less等) CSS预处理器最大的好处就是可以支持模块引入,用js的方式来编写CSS, 编译之后,终究还是一个文件,因此不可避免的会出现冲突样式 插个题外话:sass vs scss Sass 是以严格的缩进式语法规则来书写,不带大括号({})和分号(;),而 SCSS 的语法书写和我们的 CSS 语法书写方式非常类似 3. BEM :BEM就是为了解决命名冲突以及更好的语义化而生的 BEM名词解释: - Block :逻辑和页面功能都独立的页面组件,是一个可复用单元,特点如下: 可以随意嵌套组合 可以放在任意页面的任何位置,不影响功能和外观 可复用,界面可以有任意多个相同Block的实例 - Element :Block的组成部分,依赖Block存在(出了Block就不能用) - Modifier [可选] 是一个元素的状态显示,例如active、current、selected,只能定义Block和Element的外观及行为, 【说明】 - Block完全独立,可以嵌套,一个header是一个Block,header下的搜索框也可以是一个Block 不可能出现Block_

Vue JS 2.0 not rendering anything?

萝らか妹 提交于 2019-12-20 08:23:35
问题 Using Vue (^2.0.0-rc.6) + Browserify, entry point is index.js: import Vue from 'vue' import App from './containers/App.vue' new Vue({ // eslint-disable-line no-new el: '#root', render: (h) => h(App) }) App.vue: <template> <div id="root"> <hello></hello> </div> </template> <script> import Hello from '../components/Hello.vue' export default { components: { Hello } } </script> <style> body { font-family: Helvetica, sans-serif; } </style> Hello.vue: <template> <div class="hello"> <h1>\{{ msg }}<

How to uglify output with Browserify in Gulp?

妖精的绣舞 提交于 2019-12-20 08:18:32
问题 I tried to uglify output of Browserify in Gulp, but it doesn't work. gulpfile.js var browserify = require('browserify'); var gulp = require('gulp'); var uglify = require('gulp-uglify'); var source = require('vinyl-source-stream'); gulp.task('browserify', function() { return browserify('./source/scripts/app.js') .bundle() .pipe(source('bundle.js')) .pipe(uglify()) // ??? .pipe(gulp.dest('./build/scripts')); }); As I understand I cannot make it in steps as below. Do I need to make in one pipe

How to uglify output with Browserify in Gulp?

感情迁移 提交于 2019-12-20 08:18:10
问题 I tried to uglify output of Browserify in Gulp, but it doesn't work. gulpfile.js var browserify = require('browserify'); var gulp = require('gulp'); var uglify = require('gulp-uglify'); var source = require('vinyl-source-stream'); gulp.task('browserify', function() { return browserify('./source/scripts/app.js') .bundle() .pipe(source('bundle.js')) .pipe(uglify()) // ??? .pipe(gulp.dest('./build/scripts')); }); As I understand I cannot make it in steps as below. Do I need to make in one pipe

How do I write angular2 without decorator syntax?

社会主义新天地 提交于 2019-12-20 05:25:28
问题 I'm roughly following JavaScript/TypeScript quickstart for Angular2 to write my app in ES6 but can't get the decoractor to works entry.js import * as stylesheet from '../assets/styles/app.scss'; import jQuery from '../node_modules/jquery/dist/jquery'; import $ from '../node_modules/jquery/dist/jquery'; import * as semanticUi from '../node_modules/semantic-ui/dist/semantic'; import '../node_modules/angular2/bundles/angular2-polyfills' import '../node_modules/rxjs/bundles/Rx.umd' import '..

Using Browserify with jQuery Plugins

て烟熏妆下的殇ゞ 提交于 2019-12-19 16:49:13
问题 Some brief background: I'm using browserify and browserify-shim (and gulp to build) to create a web app. Prior to this issue, I was require ing jquery from npm so I had no issues. Once I started doing some optimization, I realized how massive the bundle was with jQuery included. So now I'm grabbing jQuery from a CDN with the script tag and placing it before the bundle.js file. But I'm having issues declaring jQuery as a global and properly shimming my jQuery plugins in browserify and

Gulp Error: watch ENOSPC

核能气质少年 提交于 2019-12-19 06:20:28
问题 Hi i'm getting this error while running gulp watch. im using vueify in laravel project. why is this happening. it was working fine all these days and this came in today. $ gulp watch [12:56:01] Using gulpfile ~/Documents/web_projects/next-home/gulpfile.js [12:56:01] Starting 'watch'... [12:56:01] Starting 'browserify'... Fetching Browserify Source Files... - resources/assets/js/app.js Saving To... - public/js/app.js [12:56:02] Finished 'browserify' after 707 ms [12:56:02] 'watch' errored

Can't get external library with browserify and debowerify

蓝咒 提交于 2019-12-18 21:54:31
问题 I have a headache on my hands. Here's my current setup: bower to get vendor libraries (angular in this case) gulp task to run browserify debowerify to make the bower libraries compatible with browserify App.js (before browserify): 'use strict'; var angular = require("angular"); var Routes = require("./routes"); angular.module('MyAngularApp') .config(Routes); App.js (after browserify/in the bundle.js): var angular = require("./../ext/angular/angular.js"); var Routes = require("./routes");

Promise is undefined in IE11 using babel-polyfill

我们两清 提交于 2019-12-18 12:55:18
问题 As the title says, even I'd like to use babel-polyfill to allow me to use promises in my code, but I get that undefined error in IE11. I've been trying to make this work for a while as I've seen that has been asked in different sites a few times, but none of the solutions really worked for me (or more accurately I was probably not able to adapt them to my code) These are the files that, I think, are involved: .babelrc { "presets": [ "es2015", "react" ] } package.json: I have babel-polyfill