Skip to content

Commit 972de53

Browse files
committed
infra(site) Copy assets when building
1 parent 710188c commit 972de53

File tree

4 files changed

+1040
-157
lines changed

4 files changed

+1040
-157
lines changed

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@
4848
}
4949
},
5050
"lint-staged": {
51-
"*.{js,jsx,md}": ["npm run lint:js"],
52-
"*.md": ["npm run lint:markdown"]
51+
"*.{js,jsx,md}": [
52+
"npm run lint:js"
53+
],
54+
"*.md": [
55+
"npm run lint:markdown"
56+
]
5357
},
5458
"devDependencies": {
5559
"@octokit/rest": "^15.2.6",
@@ -63,7 +67,7 @@
6367
"babel-plugin-transform-object-rest-spread": "^6.26.0",
6468
"babel-preset-env": "^1.6.0",
6569
"babel-preset-react": "^6.24.1",
66-
"copy-webpack-plugin": "^4.3.0",
70+
"copy-webpack-plugin": "4.5.2",
6771
"cross-env": "5.2.0",
6872
"css-loader": "^0.28.5",
6973
"directory-tree": "2.1.0",
@@ -123,9 +127,9 @@
123127
},
124128
"dependencies": {
125129
"@rigor789/remark-autolink-headings": "^5.1.0",
130+
"ajv": "^5.5.2",
126131
"docsearch.js": "^2.5.2",
127132
"gitter-sidecar": "^1.2.3",
128-
"ajv": "^5.5.2",
129133
"javascriptstuff-db": "^1.12.0",
130134
"lodash.throttle": "^4.1.1",
131135
"prop-types": "^15.5.10",

src/utilities/fetch-supporters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ request(url)
2626
}
2727

2828
// Write the file
29-
return asyncWriteFile(`./src/components/Support/${filename}`, body);
29+
return asyncWriteFile(`./src/components/Support/${filename}`, body).then(() => console.log('Fetched 1 file: _supporters.json'));
3030
})
3131
.catch(error => {
3232
console.error('utilities/fetch-supporters:', error);

webpack.prod.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const merge = require('webpack-merge');
55
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
66
const SSGPlugin = require('static-site-generator-webpack-plugin');
77
const RedirectWebpackPlugin = require('redirect-webpack-plugin');
8+
const CopyWebpackPlugin = require('copy-webpack-plugin');
89
const flattenContentTree = require('./src/utilities/flatten-content-tree');
910
const contentTree = require('./src/_content.json');
1011

@@ -28,7 +29,11 @@ const prod = {
2829
}),
2930
new webpack.DefinePlugin({
3031
'process.env.NODE_ENV': JSON.stringify('production')
31-
})
32+
}),
33+
new CopyWebpackPlugin([{
34+
from: './assets/icon-square-small-slack.png',
35+
to: './assets/'
36+
}])
3237
]
3338
};
3439

0 commit comments

Comments
 (0)