diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index 718b898bb8d..ec47880e82f 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -53,6 +53,7 @@ module.exports = { appPublic: resolveApp('public'), appHtml: resolveApp('public/index.html'), appIndexJs: resolveApp('src/index.js'), + backgroundJs: resolveApp('src/background.js'), appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), yarnLockFile: resolveApp('yarn.lock'), @@ -73,6 +74,7 @@ module.exports = { appPublic: resolveApp('public'), appHtml: resolveApp('public/index.html'), appIndexJs: resolveApp('src/index.js'), + backgroundJs: resolveApp('src/background.js'), appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), yarnLockFile: resolveApp('yarn.lock'), @@ -103,6 +105,7 @@ if ( appPublic: resolveOwn('template/public'), appHtml: resolveOwn('template/public/index.html'), appIndexJs: resolveOwn('template/src/index.js'), + backgroundJs: resovleOwn('template/src/background.js'), appPackageJson: resolveOwn('package.json'), appSrc: resolveOwn('template/src'), yarnLockFile: resolveOwn('template/yarn.lock'), diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 3b2a2068db2..248719d6aed 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -64,7 +64,10 @@ module.exports = { // You can exclude the *.map files from the build during deployment. devtool: shouldUseSourceMap ? 'source-map' : false, // In production, we only want to load the polyfills and the app code. - entry: [require.resolve('./polyfills'), paths.appIndexJs], + entry: { + main: [require.resolve('./polyfills'), paths.appIndexJs], + background: paths.backgroundJs + }, output: { // The build folder. path: paths.appBuild, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 1886de22830..7044beb521c 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,5 +1,5 @@ { - "name": "react-scripts", + "name": "react-scripts-chrome-extension", "version": "1.1.4", "description": "Configuration and scripts for Create React App.", "repository": "facebookincubator/create-react-app",