@@ -4,21 +4,18 @@ const path = require('path');
44const webpack = require ( 'webpack' ) ;
55const createBabelConfig = require ( './babelrc' ) ;
66const nodeExternals = require ( 'webpack-node-externals' ) ;
7- const MinifierPlugin = webpack . optimize . UglifyJsPlugin ;
87
98const exampleRoot = './examples/parallax-example/' ;
109
1110const clientConfig = {
1211 entry : path . resolve ( exampleRoot + 'client.js' ) ,
1312 output : {
14- path : path . resolve ( exampleRoot + 'dist' ) ,
13+ path : path . resolve (
14+ PRODUCTION ? exampleRoot + 'static' : exampleRoot + 'dist'
15+ ) ,
1516 filename : 'bundle.js' ,
1617 } ,
1718
18- plugins : [
19- PRODUCTION && new MinifierPlugin ( ) ,
20- ] . filter ( e => e ) ,
21-
2219 resolve : {
2320 alias : {
2421 'react-scroll-parallax' : path . resolve ( './src' ) ,
@@ -84,14 +81,12 @@ const serverConfig = {
8481
8582 entry : path . resolve ( exampleRoot + 'server.js' ) ,
8683 output : {
87- path : path . resolve ( exampleRoot + 'dist' ) ,
84+ path : path . resolve (
85+ PRODUCTION ? exampleRoot + 'static' : exampleRoot + 'dist'
86+ ) ,
8887 filename : 'server.js' ,
8988 } ,
9089
91- plugins : [
92- PRODUCTION && new MinifierPlugin ( ) ,
93- ] . filter ( e => e ) ,
94-
9590 resolve : {
9691 alias : {
9792 'react-scroll-parallax' : path . resolve ( './src' ) ,
@@ -135,4 +130,4 @@ const serverConfig = {
135130 } ,
136131} ;
137132
138- module . exports = [ clientConfig , serverConfig ] ;
133+ module . exports = PRODUCTION ? [ clientConfig ] : [ clientConfig , serverConfig ] ;
0 commit comments