Skip to content

Commit

Permalink
Fix: Add client/extensions as root for server.
Browse files Browse the repository at this point in the history
This adds `client/extensions` as a root path for the server build. This
allows extension-based imports like is already allowed on the client.

Where this makes a difference is especially in the reducers and
sections, which are built by webpack loaders.

This also specifies the root directory for the index.js entry point,
because it was conflicting with `client/extensions/index.js`
  • Loading branch information
coderkevin committed Jun 2, 2017
1 parent 089cc07 commit 755a636
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webpack.config.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function getExternals() {

const webpackConfig = {
devtool: 'source-map',
entry: 'index.js',
entry: path.join( __dirname, 'index.js' ),
target: 'node',
output: {
path: path.join( __dirname, 'build' ),
Expand Down Expand Up @@ -93,7 +93,7 @@ const webpackConfig = {
},
resolve: {
extensions: [ '', '.json', '.js', '.jsx' ],
root: [ path.join( __dirname, 'server' ), path.join( __dirname, 'client' ), __dirname ],
root: [ __dirname, path.join( __dirname, 'server' ), path.join( __dirname, 'client' ), path.join( __dirname, 'client', 'extensions' ) ],
modulesDirectories: [ 'node_modules' ]
},
node: {
Expand Down

0 comments on commit 755a636

Please sign in to comment.