forked from jantimon/html-webpack-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not modify index.ejs with default viewport meta tag
Take into account `src/index.ejs` existence while deciding to add default meta-tags. Closes: jantimon#1387
- Loading branch information
Showing
9 changed files
with
537 additions
and
4 deletions.
There are no files selected for viewing
478 changes: 478 additions & 0 deletions
478
examples/default-template-location/dist/webpack-5/bundle.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="MobileOptimized" content="width"><script defer="defer" src="bundle.js"></script></head><body><h1>Template</h1></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# default template location | ||
|
||
in this example a template is placed in the default location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('./main.css'); | ||
var h1 = document.createElement('h1'); | ||
h1.innerHTML = 'Hello world!'; | ||
document.body.appendChild(h1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="MobileOptimized" content="width"> | ||
</head> | ||
<body> | ||
<h1>Template</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: snow; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var path = require('path'); | ||
var HtmlWebpackPlugin = require('../..'); | ||
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; | ||
|
||
module.exports = { | ||
context: __dirname, | ||
entry: './src/example.js', | ||
output: { | ||
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), | ||
publicPath: '', | ||
filename: 'bundle.js' | ||
}, | ||
module: { | ||
rules: [ | ||
{ test: /\.css$/, use: ['style-loader', 'css-loader'] }, | ||
{ test: /\.png$/, type: 'asset/resource' } | ||
] | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin() | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters