Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

inline-script-webpack-plugin

inline your script when using webpack requiring html-webpack-plugin

Requirements

  • node >= 6.0 with npm
  • html-webpack-plugin

Installation

npm install inline-script-webpack-plugin --save-dev
#or
npm i inline-script-webpack-plugin -D

Usage:

for webpack.config.js:

//single scriptmodule.exports={entry: {//...inline: []},//...plugins: [//...newHtmlWebpackPlugin(),newInlineScriptWebpackPlugin(),//default chunk name will be `inline` if no name option is given//...]}//multi scripts and custom entrymodule.exports={entry: {//...foo: [],bar: []},//...plugins: [//...newHtmlWebpackPlugin(),newInlineScriptWebpackPlugin({names:['foo','bar']}),//multi scripts require names options//...]}

for index.html or template:

<!doctype html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><metahttp-equiv="X-UA-Compatible" content="ie=edge"><title>Template</title><!--multi and ordered--><%=htmlWebpackPlugin.files.foo%><%=htmlWebpackPlugin.files.bar%></head><body><!--single--><%=htmlWebpackPlugin.files.inline%></body></html>

About

inline your script when using webpack requiring html-webpack-plugin

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages