Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Component Build Command #3

Merged
merged 3 commits into from
Jan 28, 2020
Merged

Add Component Build Command #3

merged 3 commits into from
Jan 28, 2020

Conversation

JoshEstus
Copy link

No description provided.

Copy link

@criles25 criles25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you're on the right path here. feel free to reach out to me if you have a question or get confused.

edit: don't forget to update the version number in the packages/react-scripts/package.json

const chalk = require('react-dev-utils/chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const configFactory = require('../config/webpack.config');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part might be slightly tricky, but basically we will need to change the config object that configFactory produces on like 63.

it could be as simple as reassigning some of the properties and values inside the object.

@@ -24,7 +24,7 @@ const scriptIndex = args.findIndex(
const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];

if (['build', 'eject', 'start', 'test'].includes(script)) {
if (['build', 'eject', 'start', 'test', 'build-component'].includes(script)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you're on the right path here. i don't know all the places you have to declare this new build-component script exists, but we could probably just grep for build or whatever to find out.

@JoshEstus JoshEstus requested a review from criles25 January 27, 2020 15:23
default: false,
},
};
config.output.filename = 'main.js';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just making a note here

we will eventually want to declare external dependencies here.

Copy link

@criles25 criles25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@criles25 criles25 merged commit 1087060 into master Jan 28, 2020
@criles25 criles25 deleted the component-build branch January 28, 2020 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants