-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial release of brand-assets package
- Loading branch information
1 parent
8609c31
commit 37e3337
Showing
6 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
dist | ||
*.log | ||
.idea | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import transform from 'lodash/transform' | ||
|
||
const buildAbsoluteResourceUrls = (resources) => ( | ||
transform(resources, (result, resource) => { | ||
result['svg'][resource] = require(`./images/${resource}.svg`) | ||
result['png'][resource] = require(`./images/${resource}.png`) | ||
result['eps'][resource] = require(`./images/${resource}.eps`) | ||
}, {svg: {}, png: {}, eps: {}}) | ||
) | ||
|
||
const RESOURCE_URLS = buildAbsoluteResourceUrls([ | ||
'standard', | ||
'standard-padded', | ||
'standard-padded-markup', | ||
'inverted', | ||
'inverted-padded', | ||
'inverted-background', | ||
'inverted-padded-background', | ||
'mark-standard', | ||
'mark-standard-padded', | ||
'mark-standard-padded-markup', | ||
'mark-inverted', | ||
'mark-inverted-padded', | ||
'mark-inverted-padded-background', | ||
'powered-by', | ||
'powered-by-padded', | ||
'powered-by-inverted-padded', | ||
'powered-by-inverted-padded-background', | ||
'old-standard', | ||
'old-inverted', | ||
'old-mark', | ||
'old-mark-inverted' | ||
]) | ||
|
||
export const logo = (name, ext = 'svg') => ( | ||
RESOURCE_URLS[ext][name] | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const path = require('path') | ||
|
||
const CDN_ROOT = 'https://raw.githubusercontent.com/everydayhero/experience/master/packages/brand-assets/source/images/' | ||
|
||
const config = { | ||
entry: { | ||
'index': './source/index.js' | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
libraryTarget: 'commonjs-module', | ||
path: path.resolve(__dirname, 'dist') | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: [ | ||
{ | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['latest', 'stage-0'] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.(png|svg|eps)$/, | ||
loader: 'file-loader' | ||
} | ||
] | ||
}, | ||
devtool: 'source-map' | ||
} | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
config.output.publicPath = CDN_ROOT | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters