This repository was archived by the owner on May 8, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import path from 'path'
2+ import childProcess from 'child_process'
3+ import webpack from 'webpack'
4+ import config from '../config'
5+ import isomorphicWebpackConfig from '../webpack.isomorphic'
6+ import AssetsPlugin from 'assets-webpack-plugin'
7+ import WebpackAssetsManifest from 'webpack-assets-manifest'
8+ const {
9+ CLIENT_DIST_PATH ,
10+ NODE_ENV ,
11+ srcPath,
12+ distPath,
13+ publicPath,
14+ isProduction,
15+ title
16+ } = config
17+
18+ const exec = childProcess . execSync
19+ exec ( `rm -rf ${ CLIENT_DIST_PATH } ` )
20+
21+ const definePluginArgs = {
22+ 'process.env.BROWSER' : JSON . stringify ( true )
23+ }
24+
25+ const baseBuild = {
26+ name : 'client' ,
27+ entry : {
28+ client : path . join ( srcPath , './client' )
29+ } ,
30+ output : {
31+ filename : '[name].js' ,
32+ publicPath,
33+ path : CLIENT_DIST_PATH ,
34+ chunkFilename : '[name].[chunkhash:6].js'
35+ } ,
36+ performance : {
37+ hints : false
38+ } ,
39+ resolve : {
40+ modules : isomorphicWebpackConfig . resolve . modules ,
41+ extensions : isomorphicWebpackConfig . resolve . extensions . concat ( )
42+ } ,
43+ plugins : isomorphicWebpackConfig . plugins . concat ( [
44+ new webpack . DefinePlugin ( definePluginArgs ) ,
45+ new AssetsPlugin ( {
46+ path : CLIENT_DIST_PATH
47+ } )
48+ ] ) ,
49+ target : 'web'
50+ }
51+
52+ export default baseBuild
You can’t perform that action at this time.
0 commit comments