d-bitz/html-webpack-inline-source-plugin
关于
Embed javascript and css source inline when using the webpack dev server or middleware
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文This plugin is no longer maintained.
see: https://github.com/icelam/html-inline-script-webpack-plugin
Inline Source extension for the HTML Webpack Plugin
Enhances html-webpack-plugin
functionality by adding the {inlineSource: 'regex string'} option.
This is an extension plugin for the webpack plugin html-webpack-plugin (version 4 or higher). It allows you to embed javascript and css source inline.
Installation
You must be running webpack on node 6 or higher.
Install the plugin with npm:
$ npm install --save-dev html-webpack-inline-source-plugin
Basic Usage
Require the plugin in your webpack config:
var HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
Add the plugin to your webpack config as follows:
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackInlineSourcePlugin()
]
The above configuration will actually do nothing due to the configuration defaults.
When you set inlineSource to a regular expression the source code for any javascript or css file names that match will be embedded inline in the resulting html document.
plugins: [
new HtmlWebpackPlugin({
inlineSource: '.(js|css)$' // embed all javascript and css inline
}),
new HtmlWebpackInlineSourcePlugin()
]
Sourcemaps
If any source files contain a sourceMappingURL directive that isn't a data URI, then the sourcemap URL is corrected to be relative to the domain root (unless it already is) instead of to the original source file.
All sourcemap comment styles are supported:
//# ...//@ .../*# ...*//*@ ...*/
探索相关项目
加载中…