diff --git a/package.json b/package.json index 7485b94..0de6e17 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build:pages": "babel-node ./tasks/build.js", "build:js": "webpack --config webpack.config.js", "build:css": "postcss -c postcss.config.json -o dist/styles.css styles/main.css", + "build:assets": "babel-node ./tasks/assets.js", "watch": "babel-node ./tasks/watch.js", "clean": "babel-node ./tasks/clean.js", "test": "echo \"Error: no test specified\" && exit 1" diff --git a/tasks/assets.js b/tasks/assets.js new file mode 100644 index 0000000..bbb4066 --- /dev/null +++ b/tasks/assets.js @@ -0,0 +1,12 @@ +import { copy } from 'fs-extra'; +import { + assetsPath, + distPath, +} from './file'; + +copy(assetsPath(), distPath('assets'), (err) => { + if (err) { + return console.error(err); + } + console.log("copied assets"); +}); diff --git a/tasks/file.js b/tasks/file.js index 84c856d..4ff8f38 100644 --- a/tasks/file.js +++ b/tasks/file.js @@ -21,6 +21,10 @@ export const stylesPath = (...pathInSrc) => ( relativePath('styles', ...pathInSrc) ); +export const assetsPath = (...pathInSrc) => ( + relativePath('assets', ...pathInSrc) +); + export const jsPath = (...pathInSrc) => ( relativePath('js', ...pathInSrc) ); diff --git a/tasks/watch.js b/tasks/watch.js index c4ad50b..be1ddb3 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -3,6 +3,7 @@ import { exec } from 'child_process'; import { stylesPath, + assetsPath, jsPath, radarPath, staticPath, @@ -26,6 +27,7 @@ const options = { watch(stylesPath(), options, watchBuild('css')); watch(jsPath(), options, watchBuild('js')); +watch(assetsPath(), options, watchBuild('assets')); watch(radarPath(), options, watchBuild('pages')); watch(staticPath(), options, watchBuild('pages')); watch(templatesPath(), options, watchBuild('pages'));