Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Copy glyphicons from node_modules (#1401)
  • Loading branch information
Hirse committed Jul 13, 2020
1 parent 5f8c1e1 commit 161a039
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 293 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ coverage/
dist/
node_modules/
public/css/
public/fonts/glyphicons-*
public/js/

# Ignore compiled files
Expand Down
Binary file removed public/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
288 changes: 0 additions & 288 deletions public/fonts/glyphicons-halflings-regular.svg

This file was deleted.

Binary file removed public/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file removed public/fonts/glyphicons-halflings-regular.woff
Binary file not shown.
Binary file removed public/fonts/glyphicons-halflings-regular.woff2
Binary file not shown.
26 changes: 21 additions & 5 deletions scripts/build.js
Expand Up @@ -89,14 +89,24 @@ const baseDir = path.join(__dirname, '..');
);

// copy
console.log('copy');
console.log('copy bootstrap fonts');
await Promise.all(
[
'node_modules/bootstrap/fonts/glyphicons-halflings-regular.eot',
'node_modules/bootstrap/fonts/glyphicons-halflings-regular.svg',
'node_modules/bootstrap/fonts/glyphicons-halflings-regular.ttf',
'node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff',
'node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2',
].map(async (file) => {
await copyToFolder(file, 'public/fonts');
})
);

console.log('copy raven');
await Promise.all(
['node_modules/raven-js/dist/raven.min.js', 'node_modules/raven-js/dist/raven.min.js.map'].map(
async (file) => {
const source = path.join(baseDir, file);
const destination = path.join(baseDir, 'public/js', path.basename(source));
await fs.copyFile(source, destination);
console.log(`copy ${path.relative(baseDir, destination)}`);
await copyToFolder(file, 'public/js');
}
)
);
Expand Down Expand Up @@ -129,3 +139,9 @@ async function browserifyFile(source, destination) {
});
console.log(`browserify ${path.relative(baseDir, destination)}`);
}
async function copyToFolder(source, destination) {
source = path.join(baseDir, source);
destination = path.join(baseDir, destination, path.basename(source));
await fs.copyFile(source, destination);
console.log(`copy ${path.relative(baseDir, destination)}`);
}

0 comments on commit 161a039

Please sign in to comment.