1 // Original from https://github.com/mxstbr/react-boilerplate/
5 // No need to build the DLL in production
6 if (process.env.NODE_ENV === 'production') {
10 require('shelljs/global')
12 const path = require('path')
13 const fs = require('fs')
14 const exists = fs.existsSync
15 const writeFile = fs.writeFileSync
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')
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.
25 mkdir('-p', outputPath)
27 echo('Building the Webpack DLL...')
30 * Create a manifest so npm install doesn't warn us
32 if (!exists(dllManifestPath)) {
36 name: 'react-boilerplate-dlls',
39 repository: pkg.repository,
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')