Skip to content

Commit 0cb2072

Browse files
authored
Added static directory to build step (#55)
- add directory `src/static` - provide README in `src/static` - update copy run script to recursively copy the directory to `dist/static` - refactor favicon to be copied via the static dir - reference favicon from new location in `index.html` Closes #54
1 parent 07bfcf8 commit 0cb2072

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dist": "npm run clean && npm run copy && webpack --progress --bail --env dist -p",
1414
"lint": "eslint ./src",
1515
"clean": "rimraf dist/*",
16-
"copy": "copyfiles -f ./src/index.html ./src/favicon.ico ./dist",
16+
"copy": "copyfiles -f ./src/index.html ./dist && copyfiles -u 1 \"./src/static/**\" ./dist",
1717
"release:major": "npm version prerelease && git push --follow-tags && npm publish --tag beta",
1818
"release:minor": "npm version prerelease && git push --follow-tags && npm publish --tag beta",
1919
"release:patch": "npm version prerelease && git push --follow-tags && npm publish --tag beta"

src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
9+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
910
</head>
1011
<body>
1112
<div id="app">APPLICATION CONTENT</div>

src/static/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# static
2+
3+
Files and directories that you put in `static` will be copied to the
4+
`dist/static` directory during the build step. Use it to provide
5+
arbitrary static assets that can be referenced by path in your
6+
application.
File renamed without changes.

0 commit comments

Comments
 (0)