Socket
Socket
Sign inDemoInstall

webpack-bbq

Package Overview
Dependencies
36
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-bbq

webpack your bbq


Version published
Weekly downloads
175
increased by660.87%
Maintainers
5
Install size
73.8 MB
Created
Weekly downloads
 

Readme

Source

webpack-bbq

Supported Features

✔︎ 转化 src 到 lib
✔︎ 生成 app-revisions.json
✔︎ 装配 loaders: javascript, stylesheets, json, fonts, images, medias
✔︎ 兼容 Node.js: process.env.NODE_ENV 和 __dirname, __filename
✔︎ server rendering
✔︎ static rendering


webpack-bbq/libify

Show Your Webpack Loader Transformed Source!

约定

  • 使用到的 src 源码需要转化到 lib 中
  • src 中 require 的 id 不需要进行改变: abc.css -> abc.css.js, abc.jsx -> abc.jsx.js
  • 支持 ts 和 tsx 文件,ts 文件配合resolve.extensions直接引入, abc.ts -> abc.js
  • 所有 lib 中的模块 node 可运行

用法

// in your webpack.config.js
const libify = require.resolve('webpack-bbq/libify');

module.rules: [ { loader: libify, enforce: 'post', options: { webpackConfigPath } } ]

webpack_public_path

基于 require('js-tokens') 技术, 使用类 require("../webpack.config")[0].output.publicPath 替换掉 __webpack_public_path__


AppRevisions Generator for Webpack

Webpack Plugin that generates a app-resisions of bundled files.

Usage

// webpack.config.js  
var AppRevisionsGenerator = require('webpack-bbq/AppRevisionsGenerator');

var config = {
  ...
  entry: {
    "bundle": "./src/application.js",
    "vendors": "./vendors/vendors.js"
  },
  output: {
    path: './public/assets/',
    filename: 'js/[name]-[hash].js',
    publicPath: "http://example.com/assets"
  },
  plugins: {
    new AppRevisionsGenerator("PATH_TO_DEST_DIRECTORY")
  }
  ...
}

module.exports = config;

Output

{
  "bundle.js": "js/bundle-f34dc68a3493edfcaa3a.js",
  "vendors.js": "js/vendors-13adcef238710a91e834.js"
}

Keywords

FAQs

Last updated on 20 Apr 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc