
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
整个程序是依赖于 webpack , gulp 做模块管理之外的事
/data 以及 /src 两个文件夹与本项目无关,只是例子
如何安装
npm install febd --save-dev
如何使用
var Febd = require('febd');
var febd = new Febd(/*config*/); // config 在后面会讲到, 当然这个配置项是必须的
febd 提供的接口
// 启动 mock 服务
febd.mock(opts);
// 启动调试服务
// callback(makerWebpackConfig, webpack) makeWebpackConfig.get() 之前对 makeWebpack 进行其他操作
// 这个栗子 #A 会在后面讲到
febd.devSatart(callback);
// 启动模拟线上的前端打包环境
febd.build(gulpCallback, callback);
// 启动前端服务 - 这个仅用在 .build 情况下
febd.connect();
makerWebpackConfig 提供的接口 (有一些我就略过了)
.set(webpackConfig) - 直接传入一个 webpackConfig.js - 如果你很熟悉 webpack 的配置项了,就直接用这个吧
.setAlias(aliasObject) - 设置 alias
.addLoaders(loaders) {Array|Object} - ([{loader}, {loader}]) | {loader}
.clearLoaders()
.addPlugins(plugins) {Array}
... 还有一些就看源码吧,注释都加上了
有两个必须的文件
上面2个文件你可以在 node_modules/febd 中拷贝样例
直接看 node_modules/febd 中的例子哇,主要是做了一些基础配置项
var path = require('path');
var srcDir = path.resolve(process.cwd(), 'src');
var setMaker = function (maker, webpack) {
maker.setAlias({
zepto: srcDir + '/static/js/common/zepto',
ui: './ui/'
});
maker.addPlugins([
new webpack.ProvidePlugin({
$: 'zepto'
})
]);
};
/**
* DEV
*/
gulp.task('dev-webpack', function (callback) {
// 这里就是上面要说的栗子 #A
febd.devStart(function (maker, webpack) {
setMaker(maker, webpack);
});
});
/**
* Release
*/
gulp.task('release-webpack', function (gulpCallback) {
febd.build(gulpCallback, function (maker, webpack) {
setMaker(maker, webpack);
});
});
上面是栗子
ME: deo - denglingbo@126.com
FAQs
fe build
The npm package febd receives a total of 3 weekly downloads. As such, febd popularity was classified as not popular.
We found that febd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.