All Projects → hxlniada → Webpack Concat Plugin

hxlniada / Webpack Concat Plugin

a plugin to help webpack to concat file and inject to html

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Webpack Concat Plugin

Yumu
👫 A webpack and react solutionly tool
Stars: ✭ 86 (-5.49%)
Mutual labels:  webpack
Docker Django Example
A production ready example Django app that's using Docker and Docker Compose.
Stars: ✭ 86 (-5.49%)
Mutual labels:  webpack
Vue Lottery
🎨 抽奖以及截屏保存图片至本地
Stars: ✭ 90 (-1.1%)
Mutual labels:  webpack
Accounts Ui
Zesty.io account management application
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
Cookiecutter Webpack
Boilerplate for webpack 2, babel, react + redux + hmr, and karma. Can be inserted into existing django projects.
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
Karma Webpack Example
Karma + Webpack + Mocha + Chai + Istanbul
Stars: ✭ 88 (-3.3%)
Mutual labels:  webpack
Phaser Es6 Webpack
A bootstrap project for create games with Phaser + ES6 + Webpack.
Stars: ✭ 1,266 (+1291.21%)
Mutual labels:  webpack
Awesome Coding Javascript
📌 持续构建个人的源码库(JavaScript 原生、常用库、数据结构、算法)
Stars: ✭ 88 (-3.3%)
Mutual labels:  webpack
Github User Search
Browse GitHub users with React
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
Jest Webpack
Use jest with webpack.
Stars: ✭ 89 (-2.2%)
Mutual labels:  webpack
Hybrid Crypto Js
RSA+AES hybrid encryption implementation for JavaScript. Works with Node.js, React Native and modern browsers.
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
Ngc Webpack
Angular compiler-cli with webpack's loader chain.
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
Yipack Cli
易打包-命令行工具
Stars: ✭ 89 (-2.2%)
Mutual labels:  webpack
Phaser3 Tilemap Pack
Phaser 3 Project Template with Webpack, Tilemap, and Asset Pack
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack
React Atomic Structure
Basic Structure for React app following Atomic Design
Stars: ✭ 89 (-2.2%)
Mutual labels:  webpack
React Dashboard
🔥React Dashboard - isomorphic admin dashboard template (React.js, Bootstrap, Node.js, GraphQL, React Router, Babel, Webpack, Browsersync) 🔥
Stars: ✭ 1,268 (+1293.41%)
Mutual labels:  webpack
React Boilerplate
This project is deprecated. Please use CRA instead.
Stars: ✭ 88 (-3.3%)
Mutual labels:  webpack
Egg Vue Webpack Boilerplate
Egg Vue Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 1,302 (+1330.77%)
Mutual labels:  webpack
Award
⚙基于react的服务端渲染框架
Stars: ✭ 91 (+0%)
Mutual labels:  webpack
Grow Loader
A webpack loader to split class methods by decorators
Stars: ✭ 89 (-2.2%)
Mutual labels:  webpack

webpack-concat-plugin

Build Status npm package npm downloads

A plugin to help webpack concat js and inject into html

Why

Webpack is really powerful. However, when I want to concat the static files and inject into html without webpack JSONP code wrapper, it seems impossible to do that without other tool's help.

Install

npm install webpack-concat-plugin --save-dev

for webpack >= 4.0

npm install [email protected] --save-dev

Features

  • Concat
  • Inject to html(with html-webpack-plugin)

Usage

const ConcatPlugin = require('webpack-concat-plugin');

new ConcatPlugin({
    ...see options
    // examples
    uglify: false,
    sourceMap: false,
    name: 'result',
    outputPath: 'path/to/output/',
    fileName: '[name].[hash:8].js',
    filesToConcat: ['jquery', './src/lib/**', './dep/dep.js', ['./some/**', '!./some/excludes/**']],
    attributes: {
        async: true
    }
});

Options

uglify [boolean | object] default: false

if true the output file will be uglified

or set uglifyjs options to customize the output

sourceMap [boolean] default: false

if true, will output sourcemap

name [string] default: "result"

it's useful when you want to inject to html-webpack-plugin manully

publicPath [string|boolean] default: webpack's publicPath

if set, will be used as the public path of the script tag.

if set to false, will use relativePath.

outputPath [string]

if set, will be used as the output directory of the file.

fileName [string] default: [name].js

if set, will be used as the output fileName

filesToConcat [array] required

supported path patterns:

  • normal path
  • npm packages
  • glob

injectType ["prepend"|"append"|"none"] default: "prepend"

how to auto inject to html-webpack-plugin(only if html-webpack-plugin set inject option not to be false)

attributes [object]

if set, will be used as the extra attributes of the script tag.

Examples

Inject to html by hand

doctype html
...
    script(src=htmlWebpackPlugin.files.webpackConcat.flexible)
...

TODO

  • [ ] add css support
  • [x] auto inject to html
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].