forked from grommet/grommet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grommet-toolbox.config.js
75 lines (72 loc) · 1.83 KB
/
grommet-toolbox.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import path from 'path';
export function getPackageJSON () {
delete require.cache[require.resolve('./package.json')];
var packageJSON = require('./package.json');
delete packageJSON.config;
delete packageJSON.scripts;
packageJSON.main = 'index.js';
return packageJSON;
}
export default {
dist: path.resolve(__dirname, 'dist'),
copyAssets: [
'README.md',
{
asset: 'src/js/**',
babel: true,
ignores: ['.DS_Store']
},
{
asset: 'src/scss/**',
dist: 'dist/scss/'
},
{
asset: 'src/img/**',
dist: 'dist/img/'
},
{
filename: 'package.json',
asset: JSON.stringify(getPackageJSON(), null, 2)
}
],
scssAssets: ['src/scss/**/*.scss'],
jsAssets: ['src/js/**/*.js'],
mainJs: 'src/js/index-commonjs.js',
mainScss: 'src/scss/grommet-core/index.scss',
// icons: {
// source: 'src/img/icons',
// destination: 'src/js/components/icons/base',
// context: '../../../'
// },
sync: {
hostname: 'grommet.io',
username: 'grommet',
remoteDestination: '/var/www/html/assets/' + getPackageJSON().version
},
webpack: {
output: {
filename: 'grommet.min.js',
libraryTarget: 'var',
library: 'Grommet'
},
resolve: {
alias: {
'grommet': path.resolve(__dirname, 'src/js')
},
modulesDirectories: ['node_modules', 'src/js', 'src/scss']
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'react-addons-transition-group': 'React.addons.TransitionGroup'
}
},
distPreprocess: ['generate-index-icons', 'generate-icon-messages', 'dist-css'],
testPaths: [
'__tests__',
'!__tests__/utils/',
'!__tests__/mocks/'
],
preCommitTasks: ['generate-icons', 'jslint', 'scsslint', 'test']
};