-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathconfig.js
57 lines (55 loc) · 1.46 KB
/
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
const path = require('path')
const fs = require('fs')
const versions = {}
;['react', 'react-dom', 'jszip', 'docsearch.js'].forEach(lib => {
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'node_modules/', lib, 'package.json')))
versions[lib] = pkg.version
})
module.exports = {
appName: 'Shineout',
dev: {
publishPort: 4000,
webpackPort: 4001,
scriptPath: '/*.*',
scripts: [
`/react@${versions.react}/umd/react.production.min.js`,
`/react-dom@${versions['react-dom']}/umd/react-dom.production.min.js`,
`/jszip@${versions.jszip}/dist/jszip.min.js`,
],
styles: [
// '/prism/1.15.0/themes/prism.min.css',
`/docsearch.js@${versions['docsearch.js']}/dist/cdn/docsearch.css`,
],
},
themes: ['default', 'antd', 'antd2', 'shineout'],
webpack: {
entry: {
app: './site/index.js',
},
output: {
chunkFilename: '[name].[chunkhash].js',
filename: '[name].js',
},
// for site/
alias: {
shineout: path.resolve(__dirname, 'src'),
docs: path.resolve(__dirname, 'site/Components'),
doc: path.resolve(__dirname, 'site'),
},
devtool: 'cheap-module-source-map',
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
},
},
}