Use tachyons-modules in the build script
This commit is contained in:
parent
9aa3af1a2f
commit
8e195970f6
3 changed files with 27 additions and 5173 deletions
53
build.js
53
build.js
|
@ -1,36 +1,35 @@
|
|||
var pkg = require('./package.json')
|
||||
var tachyonsModules = require('tachyons-modules')
|
||||
var copy = require('copy-files')
|
||||
|
||||
var ignoredModules = [
|
||||
'tachyons-cli',
|
||||
'tachyons-queries' // For now, need to update to play nice
|
||||
]
|
||||
tachyonsModules().then(function (cssModules) {
|
||||
var cssModules = cssModules.map(function (cssModules) {
|
||||
return cssModule.name
|
||||
})
|
||||
|
||||
var modules = Object.keys(pkg.devDependencies).filter(function (module) {
|
||||
return (
|
||||
isTachyonsModule(module) ||
|
||||
module === 'normalize.css'
|
||||
) && ignoredModules.indexOf(module) == -1
|
||||
var files = constructFiles(cssModules.push('normalize.css'))
|
||||
|
||||
copy({
|
||||
files: files,
|
||||
dest: __dirname + '/src',
|
||||
overwrite: true
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
console.error('Error occurred copying files')
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
var files = {}
|
||||
modules.forEach(function (module) {
|
||||
var moduleLocation = getModuleCssLocation(module)
|
||||
var moduleName = getModuleKey(module)
|
||||
files['_' + moduleName + '.css'] = moduleLocation
|
||||
})
|
||||
|
||||
copy({
|
||||
files: files,
|
||||
dest: __dirname + '/src',
|
||||
overwrite: true
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
console.error('Error occurred copying files')
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
function constructFiles (modules) {
|
||||
var files = {}
|
||||
modules.forEach(function (module) {
|
||||
var moduleLocation = getModuleCssLocation(module)
|
||||
var moduleName = getModuleKey(module)
|
||||
files['_' + moduleName + '.css'] = moduleLocation
|
||||
})
|
||||
}
|
||||
|
||||
function isTachyonsModule (module) {
|
||||
return module.indexOf('tachyons') !== -1
|
||||
|
|
5146
css/tachyons.css
5146
css/tachyons.css
File diff suppressed because it is too large
Load diff
|
@ -51,6 +51,7 @@
|
|||
"tachyons-links": "^1.0.2",
|
||||
"tachyons-lists": "^1.0.2",
|
||||
"tachyons-max-widths": "^2.0.0",
|
||||
"tachyons-modules": "^1.0.0",
|
||||
"tachyons-overflow": "^1.1.0",
|
||||
"tachyons-position": "^3.0.0",
|
||||
"tachyons-queries": "^0.3.0",
|
||||
|
|
Loading…
Reference in a new issue