Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Test create-project buildable in development mode #1082

Merged

Conversation

eliperelman
Copy link
Member

Fixes #886.

This patch is a stop-gap for testing create-project output works in development mode by only overriding the build command, not start.

@eliperelman eliperelman added this to the v9 milestone Sep 6, 2018
@eliperelman eliperelman self-assigned this Sep 6, 2018
@eliperelman eliperelman requested a review from edmorley September 6, 2018 18:54
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

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

Thank you for taking this one! :-)

assert.file(join(dir, '.neutrinorc.js'));
assert.file(join(dir, 'webpack.config.js'));
assert.file(join(dir, '.eslintrc.js'));

await lintable(t, dir);
await buildable(t, dir);

const pkg = require(pkgPath); // eslint-disable-line import/no-dynamic-require

if ('start' in pkg.scripts) {
Copy link
Member

Choose a reason for hiding this comment

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

As far as I can tell, the @neutrinojs/library preset is the only one that create-project does not configure a start script for.

However the library preset does have prod-only code:

.when(process.env.NODE_ENV === 'production', (config) => {
config.when(options.clean, () => neutrino.use(clean, options.clean));
});

...so perhaps should still be tested in development mode?

Also, is it worth adding a comment saying something about "building in development mode to emulate start, until we can come up with something better"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely. I'll add the comment.

@eliperelman eliperelman merged commit c11b1c9 into neutrinojs:master Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants