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

App with multiple views #127

Open
Open
@ravinggenius

Description

@ravinggenius

I want to set the babel.only option without overwriting the remaining babel defaults. After looking through the source code, I found the only way to set babel.only was to copy the defaults and pass those through too.

server.engine('jsx', expressReact.createEngine({
	babel: {
		// glob includes all view directories in app, plus helper views like layout
		only: `${__dirname}/**/*.jsx`,
		presets: [
			'react',
			[
				'env',
				{
					targets: {
						node: 'current'
					}
				}
			]
		]
	}
}));

Would you be open to a pull request to add an extraPaths option? It would essentially change this line

assign({only: options.settings.views}, engineOptions.babel)

to

assign({only: [options.extraPaths, options.settings.views]}, engineOptions.babel)

This way I won't have to copy all the babel options just to set a custom/expanded babel.only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions