gulp-flow-webpack
Webpack bundle for gulp-flow.
Requirements
- gulp-flow must be installed.
Install
npm install --save-dev gulp-flow-webpack @babel/runtime
or
yarn add --dev gulp-flow-webpack @babel/runtime
@babel/runtime is a production dependency (since it's for the "runtime"). The transformation plugin is typically used only in development, but the runtime itself will be depended on by your deployed code.
Usage
Configure
By default this bundle is preconfigured in cfg.webpack
, only the entry
and the source path are required.
Example of a common use case with React.js:
yarn add --dev gulp-flow-webpack @babel/runtime
tasks/bundles/webpack.js
'use strict'; let path = ;let flow = ; // load webpack bundle; let cfg utils = flow;let webpack = utils;let rootPath srcDir notSrcDir = cfg; // ignore JS(X) in files taskscfgfilessrc; cfgfilessrcWatch; cfgwebpackentryapp = './' + srcDir + '/app/index.js';cfgwebpackresolvealiasapp = path; cfgwebpackplugins; cfgwebpackmodulerules0include = path;
You can overwrite:
cfgwebpackresolveextensions = '.js' '.jsx' '.json'/*,.other*/;cfgwebpackmodulerules0usepresets = '@babel/preset-env' useBuiltIns: 'usage' corejs: 3 targets: browsers: 'last 2 versions' '@babel/preset-react' // 'other'; cfgwebpackmodulerules0useplugins = '@babel/plugin-transform-runtime' '@babel/plugin-transform-modules-commonjs' '@babel/plugin-syntax-dynamic-import' // ...;
Or only change a specific config:
cfgwebpackmodulerules0useoptionspresets01useBuiltIns = 'entry';cfgwebpackmodulerules0useoptionspresets01'corejs' = '2';
eslint
eslint example:
Task
A simple example:
gulpfile.js
let gulp = ;let flow = ;let cfg gp utils = flow; // load (custom) webpack bundle; // build: JSgulp;
And run your task: gulp build.js
LICENSE
MIT (c) 2016, Nicolas Tallefourtane.
Author
Nicolas Talle |