Skip to content

Commit b847063

Browse files
committed
Fix: Copy static assets on build
Thanks @gutenye. Close styleguidist#403, styleguidist#489.
1 parent 7aae6bb commit b847063

File tree

3 files changed

+74
-5
lines changed

3 files changed

+74
-5
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"clipboard-copy": "^1.2.0",
3939
"codemirror": "^5.26.0",
4040
"common-dir": "^1.0.1",
41+
"copy-webpack-plugin": "^4.0.1",
4142
"css-loader": "^0.28.4",
4243
"doctrine": "^2.0.0",
4344
"es6-object-assign": "~1.1.0",

scripts/make-webpack-config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
const path = require('path');
44
const webpack = require('webpack');
55
const HtmlWebpackPlugin = require('html-webpack-plugin');
6-
const merge = require('webpack-merge');
76
const CleanWebpackPlugin = require('clean-webpack-plugin');
7+
const CopyWebpackPlugin = require('copy-webpack-plugin');
8+
const merge = require('webpack-merge');
89
const forEach = require('lodash/forEach');
910
const hasJsonLoader = require('./utils/hasJsonLoader');
1011
const getWebpackVersion = require('./utils/getWebpackVersion');
@@ -78,6 +79,11 @@ module.exports = function(config, env) {
7879
root: config.styleguideDir,
7980
verbose: config.verbose,
8081
}),
82+
new CopyWebpackPlugin([
83+
{
84+
from: config.assetsDir,
85+
},
86+
]),
8187
],
8288
});
8389
if (isWebpack1) {

0 commit comments

Comments
 (0)