forked from instructure/instructure-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.config.js
42 lines (36 loc) · 1.09 KB
/
build.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
const path = require('path')
const ROOT_PATH = process.cwd()
const BUILD_PATH = path.join(ROOT_PATH, '__build__')
const SRC_PATH = path.join(ROOT_PATH, 'lib')
module.exports = {
polyfills: [
'es6.object.assign',
'es6.array.find',
'es6.array.find-index',
'es6.symbol'
],
generateScopedName: function ({ env }) { // for css modules class names
return (env === 'production' || env === 'transpile') ? '[hash:base64]' : '[folder]__[local]'
},
generateComponentName: function (filepath) { // for component names in build output and docs
const parts = path.dirname(filepath).split(path.sep)
return parts[parts.length - 1]
},
files: {
logo: path.join(ROOT_PATH, 'logo.png'),
components: path.join(SRC_PATH, 'components/*/index.js'), // only top level components
docs: path.join(ROOT_PATH, 'docs/*.md')
},
paths: {
root: ROOT_PATH,
src: {
root: SRC_PATH,
docs: path.join(ROOT_PATH, 'docs/app')
},
build: {
root: BUILD_PATH,
dist: path.join(BUILD_PATH, '/dist'),
docs: path.join(BUILD_PATH, '/docs')
}
}
}