OSDN Git Service

Bump electron from 1.8.8 to 7.2.4
[bytom/bytom-electron.git] / bin / dependencies.js
1 // Original from https://github.com/mxstbr/react-boilerplate/
2
3 /*eslint-env node*/
4
5 // No need to build the DLL in production
6 if (process.env.NODE_ENV === 'production') {
7   process.exit(0)
8 }
9
10 require('shelljs/global')
11
12 const path = require('path')
13 const fs = require('fs')
14 const exists = fs.existsSync
15 const writeFile = fs.writeFileSync
16
17 const pkg = require(path.join(process.cwd(), 'package.json'))
18 const outputPath = path.join(process.cwd(), 'node_modules/dashboard-dlls')
19 const dllManifestPath = path.join(outputPath, 'package.json')
20
21 /**
22  * I use node_modules/react-boilerplate-dlls by default just because
23  * it isn't going to be version controlled and babel wont try to parse it.
24  */
25 mkdir('-p', outputPath)
26
27 echo('Building the Webpack DLL...')
28
29 /**
30  * Create a manifest so npm install doesn't warn us
31  */
32 if (!exists(dllManifestPath)) {
33   writeFile(
34     dllManifestPath,
35     JSON.stringify({
36       name: 'react-boilerplate-dlls',
37       private: true,
38       author: pkg.author,
39       repository: pkg.repository,
40       version: pkg.version,
41     }),
42     'utf8'
43   )
44 }
45
46 // the BUILDING_DLL env var is set to avoid confusing the development environment
47 exec('webpack --display-chunks --display-error-details --color --config webpack/webpack.dll.js')