popup.html? ??? JS ??? Webpack ??? ???? ?? ??? ??????
P粉727531237
2023-09-05 17:15:09
<p><code>popup.html</code>?? <code>popup.js</code>? ???? ????. ??? <code>content.js</code> ? <code>Background.js</code>? <code>popup.html</code>?? ?????. ? ?? ?? ???? ??? ?????? </p>
<pre class="brush:js;toolbar:false;">const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('??-??-????')
??.?? = {
??: {
??: './src/popup.tsx',
???: './src/content.tsx',
??: './src/Background.ts',
},
??: {
?? ??: '[??].js',
??: path.resolve(__dirname, 'dist')
},
??: {
??: [{
???: /.ts(x)?$/,
??: 'ts-??',
??: /node_modules/
}]
},
????: [
??? HtmlWebpackPlugin({
???: './src/popup.html',
???: 'popup.html'
}),
??? CopyPlugin({
??: [
{ ??: "??"
]
})
]
}
</pre>
<pre class="brush:html;toolbar:false;"><!doctype html>
<html lang="ko">
<??>
<?? ?? ??="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
?>??
<script defer="defer" src="popup.js"></script>
<script defer="defer" src="content.js"></script>
<script defer="defer" src="background.js"></script>
</??>
<??>
<div id="react-target"></div>
</body>
</html>
</pre>
<p>??? ??? ???? ??? ?? ??? ?????? </p>