1
我想爲我的js塊使用html-webpack-plugin 只有。 Bundle.css被提取文本 - 插件生成:如何從html-webpack-plugin生成的index.html中排除bundle.css?
new ExtractTextPlugin({filename: 'bundle.css, allChunks: true})
HtmlWebpackPlugin選項:
new HtmlWebpackPlugin({template: 'template/tpl.html', inject: true})
我tpl.html看起來是這樣的:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Cash Management</title>
<link href="getResource?resource=build/bundle.css&mediaType=text/css" rel="stylesheet">
</head>
<body>
<div id='root' />
</body>
</html>
我想看看類似的東西在我的index.html E本:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Cash Management</title>
<link href="getResource?moduleName=cm-ui&resource=build/bundle.css&mediaType=text/css" rel="stylesheet">
</head>
<body>
<div id='root' />
</body>
<script href="getResource?moduleName=cm-ui&resource=build/common.js" type="text/javascript"></script>
<script href="getResource?moduleName=cm-ui&resource=build/bundle.js" type="text/javascript"></script>
</html>
可有人請點我在正確的方向?
通過快速瀏覽,我在鍵'allCunks:true'中看到了一個拼寫錯誤。 =>'allChunk:true' –
謝謝,解決了! –