WhyA plugin to help webpack concat js and inject into html
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.
Installnpm install webpack-concat-plugin --save-dev
for webpack >= 4.0
npm install webpack-concat-plugin@3.0.0 --save-dev
Features
Options uglify [boolean | object] default: falseconst ConcatPlugin = require('webpack-concat-plugin');
Â
new ConcatPlugin({
    ...see options
   Â
    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
    }
});
Â
if true the output file will be uglified
or set uglifyjs options to customize the output
sourceMap [boolean] default: falseif 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 publicPathif 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].jsif set, will be used as the output fileName
filesToConcat [array] requiredsupported path patterns:
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 handdoctype html
...
script(src=htmlWebpackPlugin.files.webpackConcat.flexible)
...
TODO
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4