Skip to content

Commit 135369e

Browse files
committed
cleanup webpack config paths
1 parent f3354a0 commit 135369e

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

webpack.config.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ const createBabelConfig = require('./babelrc');
66
const nodeExternals = require('webpack-node-externals');
77
const MinifierPlugin = webpack.optimize.UglifyJsPlugin;
88

9+
const exampleRoot = './examples/parallax-example/';
10+
911
const clientConfig = {
10-
entry: path.resolve('./examples/client.js'),
12+
entry: path.resolve(exampleRoot + 'client.js'),
1113
output: {
12-
path: path.resolve('./dist'),
14+
path: path.resolve(exampleRoot + 'dist'),
1315
filename: 'bundle.js',
1416
},
1517

@@ -19,8 +21,8 @@ const clientConfig = {
1921

2022
resolve: {
2123
alias: {
22-
'react-scroll-parallax': path.resolve('./src/'),
23-
'components': path.resolve('./examples/components/'),
24+
'react-scroll-parallax': path.resolve('./src'),
25+
'components': path.resolve(exampleRoot + 'components'),
2426
},
2527
},
2628

@@ -29,8 +31,8 @@ const clientConfig = {
2931
{
3032
test: /\.js$/,
3133
include: [
34+
path.resolve(exampleRoot),
3235
path.resolve('./src'),
33-
path.resolve('./examples'),
3436
],
3537
loader: 'babel-loader',
3638
query: createBabelConfig(),
@@ -39,13 +41,13 @@ const clientConfig = {
3941
test: /\.(png|jpg|jpeg|gif|svg|cur)$/,
4042
loader: 'url-loader',
4143
include: [
42-
path.resolve('./src'),
44+
path.resolve(exampleRoot),
4345
],
4446
},
4547
{
4648
test: /\.scss$/,
4749
include: [
48-
path.resolve('./examples'),
50+
path.resolve(exampleRoot),
4951
],
5052
loaders: [
5153
'style-loader',
@@ -80,9 +82,9 @@ const serverConfig = {
8082
__dirname: true,
8183
},
8284

83-
entry: path.resolve('./examples/server.js'),
85+
entry: path.resolve(exampleRoot + 'server.js'),
8486
output: {
85-
path: path.resolve('./dist'),
87+
path: path.resolve(exampleRoot + 'dist'),
8688
filename: 'server.js',
8789
},
8890

@@ -92,8 +94,8 @@ const serverConfig = {
9294

9395
resolve: {
9496
alias: {
95-
'react-scroll-parallax': path.resolve('./src/'),
96-
'components': path.resolve('./examples/components/'),
97+
'react-scroll-parallax': path.resolve('./src'),
98+
'components': path.resolve(exampleRoot + 'components'),
9799
},
98100
},
99101

@@ -102,16 +104,16 @@ const serverConfig = {
102104
{
103105
test: /\.js$/,
104106
include: [
107+
path.resolve(exampleRoot),
105108
path.resolve('./src'),
106-
path.resolve('./examples'),
107109
],
108110
loader: 'babel-loader',
109111
query: createBabelConfig({ server: true }),
110112
},
111113
{
112114
test: /\.scss$/,
113115
include: [
114-
path.resolve('./examples'),
116+
path.resolve(exampleRoot),
115117
],
116118
loaders: [
117119
{

0 commit comments

Comments
 (0)