diff --git a/client/config/index.js b/client/config/index.js index 28002e917b5ac..1c77ea9e84f31 100644 --- a/client/config/index.js +++ b/client/config/index.js @@ -1,8 +1,7 @@ -// DO NOT USE ES6 MODULES OR IT WILL BREAK wp-desktop COMPATIBILITY /** * Internal dependencies */ -var createConfig = require( 'lib/config' ); +import createConfig from 'lib/create-config'; /** * Manages config flags for various deployment builds @@ -12,5 +11,5 @@ if ( 'undefined' === typeof window || ! window.configData ) { throw new ReferenceError( 'No configuration was found: please see client/config/README.md for more information' ); } -module.exports = createConfig( window.configData ); +export default createConfig( window.configData ); diff --git a/client/lib/config/index.js b/client/lib/create-config/index.js similarity index 100% rename from client/lib/config/index.js rename to client/lib/create-config/index.js diff --git a/client/lib/config/test/index.js b/client/lib/create-config/test/index.js similarity index 100% rename from client/lib/config/test/index.js rename to client/lib/create-config/test/index.js diff --git a/client/sections.js b/client/sections.js index 28ffa5bd29d49..9b1722291b49f 100644 --- a/client/sections.js +++ b/client/sections.js @@ -7,7 +7,8 @@ const path = require( 'path' ); /** * Internal dependencies */ -const sections = require( 'wordpress-com' ); +const config = require( 'config' ); +const sections = require( config( 'project' ) ); const extensions = require( 'extensions' ); const extensionSections = extensions.map( extension => { diff --git a/server/config/index.js b/server/config/index.js index 64186e5487a19..53fa23c713864 100644 --- a/server/config/index.js +++ b/server/config/index.js @@ -3,7 +3,7 @@ */ const configPath = require( 'path' ).resolve( __dirname, '..', '..', 'config' ); const parser = require( './parser' ); -const createConfig = require( 'lib/config' ); +const createConfig = require( 'lib/create-config' ); const { serverData: data, clientData } = parser( configPath, { env: process.env.CALYPSO_ENV || process.env.NODE_ENV || 'development',