Skip to content

Commit 317fa45

Browse files
authored
Merge pull request #55 from JSREI/dev
GitHub pages部署时复制图片
2 parents 85da581 + 0eb8eb8 commit 317fa45

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

script-hook-website/package-lock.json

Lines changed: 83 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script-hook-website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"devDependencies": {
4141
"@types/react-syntax-highlighter": "^15.5.13",
42+
"copy-webpack-plugin": "^13.0.0",
4243
"css-loader": "^6.7.3",
4344
"gh-pages": "^6.3.0",
4445
"html-webpack-plugin": "^5.5.1",

script-hook-website/webpack.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const HtmlWebpackPlugin = require('html-webpack-plugin');
3+
const CopyWebpackPlugin = require('copy-webpack-plugin');
34

45
module.exports = (env, argv) => {
56
const isProduction = argv.mode === 'production';
@@ -41,6 +42,15 @@ module.exports = (env, argv) => {
4142
'Expires': {'http-equiv': 'Expires', 'content': '0'}
4243
}
4344
}),
45+
new CopyWebpackPlugin({
46+
patterns: [
47+
{
48+
from: 'public/images',
49+
to: 'images'
50+
},
51+
// 如果有其他静态资源也需要复制,可以在这里添加
52+
]
53+
}),
4454
],
4555
devServer: {
4656
static: {

0 commit comments

Comments
 (0)