Skip to content

Commit

Permalink
Chrome extension background support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic Xiang committed Jul 20, 2018
1 parent ea7b374 commit bf77022
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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'),
Expand Down Expand Up @@ -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'),
Expand Down
5 changes: 4 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit bf77022

Please sign in to comment.