Skip to content

Commit b3b43f3

Browse files
committed
ctco-dev: extract scripts aand dependencies into separate files
1 parent 511f45e commit b3b43f3

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aeldar/react-scripts",
3-
"version": "1.1.4-8",
3+
"version": "1.1.4-9",
44
"description": "Configuration and scripts for Create React App. Modified by @aeldar",
55
"repository": "aeldar/create-react-app",
66
"license": "MIT",

packages/react-scripts/scripts/init.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ module.exports = function(
3636
appPackage.dependencies = appPackage.dependencies || {};
3737

3838
// Setup the script rules
39-
appPackage.scripts = {
40-
start: 'react-scripts start',
41-
build: 'react-scripts build',
42-
test: 'react-scripts test --env=jsdom',
43-
eject: 'react-scripts eject',
44-
};
39+
appPackage.scripts = require('./utils/scripts');
4540

4641
fs.writeFileSync(
4742
path.join(appPath, 'package.json'),
@@ -142,9 +137,13 @@ module.exports = function(
142137
console.log(`Installing react and react-dom using ${command}...`);
143138
console.log();
144139

145-
const proc = spawn.sync(command, args.concat(['react', 'react-dom']), {
146-
stdio: 'inherit',
147-
});
140+
const proc = spawn.sync(
141+
command,
142+
args.concat(require('./utils/dependencies')),
143+
{
144+
stdio: 'inherit',
145+
}
146+
);
148147
if (proc.status !== 0) {
149148
console.error(`\`${command} ${args.join(' ')}\` failed`);
150149
return;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
start: 'react-scripts start',
3+
build: 'react-scripts build',
4+
test: 'react-scripts test --env=jsdom',
5+
eject: 'react-scripts eject',
6+
7+
lint: 'tslint --project .',
8+
analyze: 'npx source-map-explorer build/static/js/main.*',
9+
};

0 commit comments

Comments
 (0)