Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Retrieve all modules referenced by the project and insert them into the html according to an externally generated script.

License

Notifications You must be signed in to change notification settings

zhanxiaoge/html-webpack-externals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

html-webpack-externals NPM version

A plugin for html-webpack-plugin that insert into html in order according to webpackConfig.externals.

Look

This plugin must webpack >= 4, html-webpack-plugin >= 4.0.

Install

$ npm install html-webpack-externals --save-dev

Example

const webpackHtmlPlugin = require('html-webpack-plugin');
const webpackHtmlExternals = require('html-webpack-externals');
{
    externals: {
        'socketio': 'io'
    },
    plugins: [
        new webpackHtmlPlugin(),
        new webpackHtmlExternals({
            resolve: {
                'socketio': 'https://cdn.bootcss.com/socket.io/2.3.0/socket.io.slim.js'
            },
            dirname: 'public'
        })
    ]
}

About

Retrieve all modules referenced by the project and insert them into the html according to an externally generated script.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published