Remove `text/javascript` from all script tags
This commit is contained in:
parent
ed00a67437
commit
c5b8382ad5
|
|
@ -7,5 +7,5 @@
|
|||
<link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -8,5 +8,5 @@
|
|||
<body>
|
||||
<h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -8,5 +8,5 @@
|
|||
<body>
|
||||
<h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
<title>Webpack App</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
<title>Webpack App</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
<title>HtmlWebpackPlugin example</title>
|
||||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
<title>HtmlWebpackPlugin example</title>
|
||||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<img src="0714810ae3fb211173e2964249507195.png">
|
||||
<script type="text/javascript" src="bundle.js"></script></body>
|
||||
<script src="bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
|
||||
background: snow;
|
||||
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
|
||||
}</style><script>/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
|
||||
background: snow;
|
||||
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
|
||||
}</style><script>/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ html
|
|||
each cssFile in htmlWebpackPlugin.files.css
|
||||
style !{compilation.assets[cssFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
|
||||
each jsFile in htmlWebpackPlugin.files.js
|
||||
script(type="text/javascript") !{compilation.assets[jsFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
|
||||
script !{compilation.assets[jsFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1998-12-31T23:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1998-12-31T23:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script src="bundle.js"></script></body></html>
|
||||
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1998-12-31T23:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1998-12-31T23:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script src="bundle.js"></script></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<html><head><title>Webpack App</title><link href="styles.css" rel="stylesheet"></head><body>Hello World from backend - <h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<html><head><title>Webpack App</title><link href="styles.css" rel="stylesheet"></head><body>Hello World from backend - <h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<head><link href="styles.css" rel="stylesheet"></head>Hello World from backend2016-10-29T07:02:05.646Z<h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<head><link href="styles.css" rel="stylesheet"></head>Hello World from backend2016-07-02T10:27:15.263Z<h2>Partial</h2>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script>
|
||||
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script>
|
||||
1
index.js
1
index.js
|
|
@ -462,7 +462,6 @@ HtmlWebpackPlugin.prototype.generateAssetTags = function (assets) {
|
|||
// Turn script files into script tags
|
||||
var scripts = assets.js.map(function (scriptPath) {
|
||||
return htmlTag.createHtmlTagObject('script', {
|
||||
type: 'text/javascript',
|
||||
src: scriptPath
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, [/<body>[\s]*<script type="text\/javascript" src="index_bundle.js"><\/script>[\s]*<\/body>/], null, done);
|
||||
}, [/<body>[\s]*<script src="index_bundle.js"><\/script>[\s]*<\/body>/], null, done);
|
||||
});
|
||||
|
||||
it('generates a default index.html file with multiple entry points', function (done) {
|
||||
|
|
@ -114,7 +114,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: '[name]_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script type="text/javascript" src="util_bundle.js"', '<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="util_bundle.js"', '<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to specify a custom loader without injection', function (done) {
|
||||
|
|
@ -131,7 +131,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
template: 'jade-loader!' + path.join(__dirname, 'fixtures/template.jade')
|
||||
})]
|
||||
},
|
||||
['<script type="text/javascript" src="app_bundle.js', 'Some unique text'], null, done);
|
||||
['<script src="app_bundle.js', 'Some unique text'], null, done);
|
||||
});
|
||||
|
||||
it('should pass through loader errors', function (done) {
|
||||
|
|
@ -170,7 +170,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
template: path.join(__dirname, 'fixtures/template.jade')
|
||||
})]
|
||||
},
|
||||
['<script type="text/javascript" src="app_bundle.js', 'Some unique text'], null, done);
|
||||
['<script src="app_bundle.js', 'Some unique text'], null, done);
|
||||
});
|
||||
|
||||
it('works when using html-loader', function (done) {
|
||||
|
|
@ -187,7 +187,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
template: 'html-loader!' + path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
},
|
||||
['<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
['<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to specify your own HTML template file', function (done) {
|
||||
|
|
@ -204,7 +204,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
inject: false
|
||||
})]
|
||||
},
|
||||
['<script type="text/javascript" src="app_bundle.js', 'Some unique text'], null, done);
|
||||
['<script src="app_bundle.js', 'Some unique text'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to inject the assets into a given html file', function (done) {
|
||||
|
|
@ -221,7 +221,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
inject: true,
|
||||
template: path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="util_bundle.js"', '<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="util_bundle.js"', '<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to inject the assets into the body of the given template', function (done) {
|
||||
|
|
@ -238,7 +238,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
inject: 'body',
|
||||
template: path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="util_bundle.js"', '<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="util_bundle.js"', '<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to inject the assets into the head of the given template', function (done) {
|
||||
|
|
@ -255,7 +255,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
inject: 'head',
|
||||
template: path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="util_bundle.js"', '<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="util_bundle.js"', '<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to inject a specified asset into a given html file', function (done) {
|
||||
|
|
@ -273,7 +273,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
chunks: ['app'],
|
||||
template: path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to inject a specified asset into a given html file', function (done) {
|
||||
|
|
@ -291,7 +291,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
excludeChunks: ['util'],
|
||||
template: path.join(__dirname, 'fixtures/plain.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
}, ['<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to use chunkhash with asset into a given html file', function (done) {
|
||||
|
|
@ -310,7 +310,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
}, [{
|
||||
type: 'chunkhash',
|
||||
chunkName: 'app',
|
||||
containStr: '<script type="text/javascript" src="app_bundle.js?%chunkhash%"'
|
||||
containStr: '<script src="app_bundle.js?%chunkhash%"'
|
||||
}], null, done);
|
||||
});
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
}
|
||||
})]
|
||||
},
|
||||
['<script type="text/javascript" src="app_bundle.js"'], null, done);
|
||||
['<script src="app_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('works with source maps', function (done) {
|
||||
|
|
@ -356,7 +356,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js"'], null, done);
|
||||
}, ['<script src="index_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('handles hashes in bundle filenames', function (done) {
|
||||
|
|
@ -367,7 +367,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle_[hash].js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, [/<script type="text\/javascript" src="index_bundle_[0-9a-f]+\.js"*/], null, done);
|
||||
}, [/<script src="index_bundle_[0-9a-f]+\.js"*/], null, done);
|
||||
});
|
||||
|
||||
it('handles hashes in the directory which has the bundle file', function (done) {
|
||||
|
|
@ -379,7 +379,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle_[hash].js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, [/<script type="text\/javascript" src="\/dist\/[0-9a-f]+\/index_bundle_[0-9a-f]+\.js"*/], null, done);
|
||||
}, [/<script src="\/dist\/[0-9a-f]+\/index_bundle_[0-9a-f]+\.js"*/], null, done);
|
||||
});
|
||||
|
||||
it('allows to append hashes to the assets', function (done) {
|
||||
|
|
@ -390,7 +390,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({hash: true})]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js?%hash%"'], null, done);
|
||||
}, ['<script src="index_bundle.js?%hash%"'], null, done);
|
||||
});
|
||||
|
||||
it('allows to append hashes to the assets', function (done) {
|
||||
|
|
@ -401,7 +401,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({hash: true, inject: true})]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js?%hash%"'], null, done);
|
||||
}, ['<script src="index_bundle.js?%hash%"'], null, done);
|
||||
});
|
||||
|
||||
it('should work with the css extract plugin', function (done) {
|
||||
|
|
@ -534,7 +534,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
publicPath: 'http://cdn.example.com/assets/'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script type="text/javascript" src="http://cdn.example.com/assets/index_bundle.js"'], null, done);
|
||||
}, ['<script src="http://cdn.example.com/assets/index_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('handles subdirectories in the webpack output bundles', function (done) {
|
||||
|
|
@ -545,7 +545,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'assets/index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script type="text/javascript" src="assets/index_bundle.js"'], null, done);
|
||||
}, ['<script src="assets/index_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('handles subdirectories in the webpack output bundles along with a public path', function (done) {
|
||||
|
|
@ -557,7 +557,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
publicPath: 'http://cdn.example.com/'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin()]
|
||||
}, ['<script type="text/javascript" src="http://cdn.example.com/assets/index_bundle.js"'], null, done);
|
||||
}, ['<script src="http://cdn.example.com/assets/index_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('allows you to configure the title of the generated HTML page', function (done) {
|
||||
|
|
@ -579,7 +579,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({filename: 'test.html'})]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js"'], 'test.html', done);
|
||||
}, ['<script src="index_bundle.js"'], 'test.html', done);
|
||||
});
|
||||
|
||||
it('will replace [hash] in the filename with the child compilation hash', function (done) {
|
||||
|
|
@ -592,7 +592,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
plugins: [new HtmlWebpackPlugin({
|
||||
filename: 'test-[hash].html'
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js"'], /test-\S+\.html$/, done);
|
||||
}, ['<script src="index_bundle.js"'], /test-\S+\.html$/, done);
|
||||
});
|
||||
|
||||
it('allows you to use an absolute output filename', function (done) {
|
||||
|
|
@ -605,7 +605,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
plugins: [new HtmlWebpackPlugin({
|
||||
filename: path.resolve(OUTPUT_DIR, 'subfolder', 'test.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="../index_bundle.js"'], path.join('subfolder', 'test.html'), done);
|
||||
}, ['<script src="../index_bundle.js"'], path.join('subfolder', 'test.html'), done);
|
||||
});
|
||||
|
||||
it('allows you to use an absolute output filename outside the output path', function (done) {
|
||||
|
|
@ -618,7 +618,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
plugins: [new HtmlWebpackPlugin({
|
||||
filename: path.resolve(OUTPUT_DIR, 'test.html')
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="app/index_bundle.js"'], 'test.html', done);
|
||||
}, ['<script src="app/index_bundle.js"'], 'test.html', done);
|
||||
});
|
||||
|
||||
it('allows you to use an relative output filename outside the output path', function (done) {
|
||||
|
|
@ -631,7 +631,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
plugins: [new HtmlWebpackPlugin({
|
||||
filename: '../test.html'
|
||||
})]
|
||||
}, ['<script type="text/javascript" src="app/index_bundle.js"'], 'test.html', done);
|
||||
}, ['<script src="app/index_bundle.js"'], 'test.html', done);
|
||||
});
|
||||
|
||||
it('will try to use a relative name if the filename is in a subdirectory', function (done) {
|
||||
|
|
@ -642,7 +642,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({filename: 'assets/test.html'})]
|
||||
}, ['<script type="text/javascript" src="../index_bundle.js"'], 'assets/test.html', done);
|
||||
}, ['<script src="../index_bundle.js"'], 'assets/test.html', done);
|
||||
});
|
||||
|
||||
it('will try to use a relative name if the filename and the script are in a subdirectory', function (done) {
|
||||
|
|
@ -653,7 +653,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
filename: 'assets/index_bundle.js'
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({filename: 'assets/demo/test.html'})]
|
||||
}, ['<script type="text/javascript" src="../../assets/index_bundle.js"'], 'assets/demo/test.html', done);
|
||||
}, ['<script src="../../assets/index_bundle.js"'], 'assets/demo/test.html', done);
|
||||
});
|
||||
|
||||
it('allows you write multiple HTML files', function (done) {
|
||||
|
|
@ -676,7 +676,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
template: path.join(__dirname, 'fixtures/test.html')
|
||||
})
|
||||
]
|
||||
}, ['<script type="text/javascript" src="index_bundle.js"'], null, function () {
|
||||
}, ['<script src="index_bundle.js"'], null, function () {
|
||||
expect(fs.existsSync(path.join(OUTPUT_DIR, 'second-file.html'))).toBe(true);
|
||||
expect(fs.existsSync(path.join(OUTPUT_DIR, 'third-file.html'))).toBe(true);
|
||||
done();
|
||||
|
|
@ -700,7 +700,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
new HtmlWebpackPlugin({template: path.join(__dirname, 'fixtures/empty_html.html')}),
|
||||
new ExtractTextPlugin('styles.css')
|
||||
]
|
||||
}, ['<link href="styles.css"', '<script type="text/javascript" src="index_bundle.js"'], null, done);
|
||||
}, ['<link href="styles.css"', '<script src="index_bundle.js"'], null, done);
|
||||
});
|
||||
|
||||
it('exposes the webpack configuration to templates', function (done) {
|
||||
|
|
@ -779,7 +779,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
examplePlugin
|
||||
]
|
||||
},
|
||||
[/<body>[\s]*<script type="text\/javascript" src="app_bundle.js" async><\/script>[\s]*<\/body>/],
|
||||
[/<body>[\s]*<script src="app_bundle.js" async><\/script>[\s]*<\/body>/],
|
||||
null, done, false, false);
|
||||
});
|
||||
|
||||
|
|
@ -812,7 +812,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
examplePlugin
|
||||
]
|
||||
},
|
||||
[/<body>[\s]*<script type="text\/javascript" src="app_bundle.js"><\/script>[\s]*<\/body>/],
|
||||
[/<body>[\s]*<script src="app_bundle.js"><\/script>[\s]*<\/body>/],
|
||||
null, done, false, false);
|
||||
});
|
||||
|
||||
|
|
@ -1107,7 +1107,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
new HtmlWebpackPlugin(),
|
||||
examplePlugin
|
||||
]
|
||||
}, ['Injected by plugin', '<script type="text/javascript" src="funky-script.js"'], null, function () {
|
||||
}, ['Injected by plugin', '<script src="funky-script.js"'], null, function () {
|
||||
expect(eventFired).toBe(true);
|
||||
done();
|
||||
}, false, true);
|
||||
|
|
@ -1141,7 +1141,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
}),
|
||||
examplePlugin
|
||||
]
|
||||
}, ['<script type="text/javascript" src="funky-script.js"'], null, function () {
|
||||
}, ['<script src="funky-script.js"'], null, function () {
|
||||
expect(eventFired).toBe(true);
|
||||
done();
|
||||
});
|
||||
|
|
@ -1167,8 +1167,8 @@ describe('HtmlWebpackPlugin', function () {
|
|||
new HtmlWebpackPlugin()
|
||||
]
|
||||
}, [
|
||||
/<script type="text\/javascript" src="common_bundle.js">[\s\S]*<script type="text\/javascript" src="util_bundle.js">/,
|
||||
/<script type="text\/javascript" src="common_bundle.js"[\s\S]*<script type="text\/javascript" src="index_bundle.js">/], null, done);
|
||||
/<script src="common_bundle.js">[\s\S]*<script src="util_bundle.js">/,
|
||||
/<script src="common_bundle.js"[\s\S]*<script src="index_bundle.js">/], null, done);
|
||||
});
|
||||
|
||||
it('adds a favicon', function (done) {
|
||||
|
|
@ -1364,7 +1364,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
})
|
||||
]
|
||||
}, [
|
||||
/<script type="text\/javascript" src="common_bundle.js">.+<script type="text\/javascript" src="util_bundle.js">.+<script type="text\/javascript" src="index_bundle.js">/], null, done);
|
||||
/<script src="common_bundle.js">.+<script src="util_bundle.js">.+<script src="index_bundle.js">/], null, done);
|
||||
});
|
||||
|
||||
it('should sort the chunks in custom (reverse alphabetical) order', function (done) {
|
||||
|
|
@ -1391,7 +1391,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
}
|
||||
})
|
||||
]
|
||||
}, [/<script type="text\/javascript" src="c_bundle.js">.+<script type="text\/javascript" src="b_bundle.js">.+<script type="text\/javascript" src="a_bundle.js">/], null, done);
|
||||
}, [/<script src="c_bundle.js">.+<script src="b_bundle.js">.+<script src="a_bundle.js">/], null, done);
|
||||
});
|
||||
|
||||
it('should sort the chunks by chunk dependencies', function (done) {
|
||||
|
|
@ -1419,7 +1419,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
})
|
||||
]
|
||||
}, [
|
||||
/<script type="text\/javascript" src="common_bundle.js">.+<script type="text\/javascript" src="aTheme_bundle.js">.+<script type="text\/javascript" src="util_bundle.js">/], null, done);
|
||||
/<script src="common_bundle.js">.+<script src="aTheme_bundle.js">.+<script src="util_bundle.js">/], null, done);
|
||||
});
|
||||
|
||||
it('should sort the chunks by chunk dependencies even if a parent chunk is excluded', function (done) {
|
||||
|
|
@ -1448,7 +1448,7 @@ describe('HtmlWebpackPlugin', function () {
|
|||
})
|
||||
]
|
||||
}, [
|
||||
/<script type="text\/javascript" src="aTheme_bundle.js">.+<script type="text\/javascript" src="util_bundle.js">/], null, done);
|
||||
/<script src="aTheme_bundle.js">.+<script src="util_bundle.js">/], null, done);
|
||||
});
|
||||
|
||||
it('should add the webpack compilation object as a property of the templateParam object', function (done) {
|
||||
|
|
@ -1478,6 +1478,6 @@ describe('HtmlWebpackPlugin', function () {
|
|||
templateContent: ''
|
||||
})]
|
||||
},
|
||||
[/^<script type="text\/javascript" src="app_bundle\.js"><\/script>$/], null, done);
|
||||
[/^<script src="app_bundle\.js"><\/script>$/], null, done);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ function runExample (exampleName, done) {
|
|||
|
||||
expect(err).toBeFalsy();
|
||||
expect(res.same).toBe(true);
|
||||
if (!res.same) {
|
||||
console.log(
|
||||
console.log(exampleName, res));
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<p>Some unique text</p>
|
||||
<script type="text/javascript" src="<%=foo.bar%>"></script>
|
||||
<script src="<%=foo.bar%>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<p>Some unique text</p>
|
||||
<script type="text/javascript" src="{%=o.htmlWebpackPlugin.assets.app%}"></script>
|
||||
<script src="{%=o.htmlWebpackPlugin.assets.app%}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ html
|
|||
body
|
||||
p Some unique text
|
||||
each jsFile in htmlWebpackPlugin.files.js
|
||||
script(type="text/javascript" src!=jsFile)
|
||||
script(src!=jsFile)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<p>Some unique text</p>
|
||||
<script type="text/javascript" src="<%=htmlWebpackPlugin.files.chunks.app.entry%>"></script>
|
||||
<script src="<%=htmlWebpackPlugin.files.chunks.app.entry%>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<p>Public path is <%= webpackConfig.output.publicPath %></p>
|
||||
<script type="text/javascript" src="<%= htmlWebpackPlugin.files.chunks.app.entry %>?<%= htmlWebpackPlugin.files.chunks.app.hash %>"></script>
|
||||
<script src="<%= htmlWebpackPlugin.files.chunks.app.entry %>?<%= htmlWebpackPlugin.files.chunks.app.hash %>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue