- Notifications
You must be signed in to change notification settings - Fork65
Embed javascript and css source inline when using the webpack dev server or middleware
License
DustinJackson/html-webpack-inline-source-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
see:https://github.com/icelam/html-inline-script-webpack-plugin
Enhanceshtml-webpack-pluginfunctionality by adding the{inlineSource: 'regex string'}
option.
This is an extension plugin for thewebpack pluginhtml-webpack-plugin (version 4 or higher). It allows you to embed javascript and css source inline.
You must be running webpack on node 6 or higher.
Install the plugin with npm:
$ npm install --save-dev html-webpack-inline-source-plugin
Require the plugin in your webpack config:
varHtmlWebpackInlineSourcePlugin=require('html-webpack-inline-source-plugin');
Add the plugin to your webpack config as follows:
plugins:[newHtmlWebpackPlugin(),newHtmlWebpackInlineSourcePlugin()]
The above configuration will actually do nothing due to the configuration defaults.
When you setinlineSource
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:[newHtmlWebpackPlugin({inlineSource:'.(js|css)$'// embed all javascript and css inline}),newHtmlWebpackInlineSourcePlugin()]
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:
//# ...
//@ ...
/*# ...*/
/*@ ...*/
About
Embed javascript and css source inline when using the webpack dev server or middleware
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors13
Uh oh!
There was an error while loading.Please reload this page.